[<<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.  The cursor is then
        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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson