How to Determine the Coordinates of a GET Field

Last reviewed: March 11, 1997
Article ID: Q111549
2.50 2.50a 2.50b 3.00 | 2.00 2.50 2.50a 2.50b | 2.50b
WINDOWS               | MS-DOS                | MACINTOSH
kbprg

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for Macintosh, version 2.5b

SUMMARY

To determine a GET field's coordinates, use the _CUROBJ variable to place the cursor in the desired GET field. Then use the COL() and ROW() functions to determine the row and column of the cursor.

MORE INFORMATION

Assign the _CUROBJ system variable to the desired GET field. (To determine the number of the field, use the OBJNUM() function.)

Once the cursor is in the GET field, use the ROW() and COL() functions to determine the coordinates of the cursor, which are the same as the first position of the GET field.

Program Example

The following program demonstrates the use of _CUROBJ, ROW(), and COL() to get the coordinates of a GET field. Press the F2 or F3 key to go to the desired field, then press F4 to display the coordinates of that field.

   ON KEY LABEL F2 DO GotoObj1
   ON KEY LABEL F3 DO GotoObj2
   ON KEY LABEL F4 DO DispXY
   SET TALK OFF

   @ 1, 2 get m.test1 DEFAULT SPACE(10)
   @ 3, 4 get m.test2 DEFAULT SPACE(10)
   READ CYCLE

   ON KEY LABEL F2
   ON KEY LABEL F3
   ON KEY LABEL F4

   PROCEDURE GoToObj1  && Places cursor in first field
   _CUROBJ = 1
   RETURN

   PROCEDURE GoToObj2  && Places cursor in second field
   _CUROBJ = 2
   RETURN

   PROCEDURE DispXY  && Displays coordinates of current field
   m.x = ROW()
   m.y = COL()
   WAIT WINDOW "X:" + STR(m.x,5,2) + ", Y: " + STR(m.y,5,2)
   RETURN


Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b
KBCategory: kbprg vFoxWin 3.00
KBSubcategory: FxprgGeneral
Keywords : FxprgGeneral
Version : 2.50 2.50a 2.50b 3.00 | 2.00 2.5
Platform : MACINTOSH MS-DOS WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.