Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - setrc() set cursor position http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setrc()             Set cursor position
------------------------------------------------------------------------------
 Declaration
   screen.hdr

 Syntax
   proc setrc extern
   param value uint uRowCol

 Arguments
   uRowCol is the combined screen row and column value.

 Return
   None.

 Description
   This function sets cursor position according to the combined row and column
   information in the uRowCol parameter. This value can be previously
   retrieved by calling the getrc() funcion.

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   proc Test_setrc
   vardef
     uint nRow, nCol
     uint nRowCol
   enddef
   
   // The conventional way to save/restore a cursor position
   clear
   nRow := row()                // save the current cursor position
   nCol := col()
   @ 10, 34 ?? "First method"   // some output stuff here
   @ nRow, nCol                 // restore the old cursor position
   getkey()
   
   // The shorter way to save/restore a cursor position
   clear
   nRowCol := getrc()           // save the current cursor position
   @ 10, 34 ?? "Second method"  // some output stuff here
   setrc( nRowCol )             // restore the old cursor position
   getkey()
   endproc

   proc main
   Test_setrc()
   endproc

See Also: col() getrc() row()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson