Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . Technical Reference - <b>_gtgetpos()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _gtGetPos()
 Get the cursor location
------------------------------------------------------------------------------
 C Prototype

     #include "gt.api"
     ERRCODE _gtGetPos(
                        USHORTP uipRow,
                        USHORTP uipCol
                      )

 Arguments

     uipRow receives the row position of the cursor.  The value received
     may range from zero to _gtMaxRow().

     uipCol receives the column position of the cursor.  The value
     received may range from zero to _gtMaxCol().

 Returns

     _gtGetPos() returns zero if successful.  Any other value indicates an
     error.

 Description

     _gtGetPos() saves the current cursor position as a pair of numeric
     coordinates, uipRow and uipCol.  You can later use the coordinates with
     _gtSetPos() to return the cursor to its prior location.

 Examples

     .  This example saves the current cursor location before
        displaying output at a specified location.  Afterwards, the cursor is
        restored to its original position:

        #include "gt.api"

        void PrintStr( USHORT uiRow, USHORT uiCol, BYTEP fpStr );

        void PrintStr( USHORT uiRow, USHORT uiCol, BYTEP fpStr )
        {
           USHORT uiSavRow;
           USHORT uiSavCol;

           _gtGetPos( &uiSavRow, &uiSavCol );      // Save position
           _gtSetPos( uiRow, uiCol );              // Set new position
           _gtWrite( fpStr, strlen( fpStr ) );
           _gtSetPos( uiSavRow, uiSavCol );        // Restore position
        }

 Files:  Library is CLIPPER.LIB, header file is Gt.api.


See Also: _gtGetCursor() _gtMaxCol() _gtMaxRow() _gtSetCursor()

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