Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ROW(), COL(), PROW(), PCOL()

Back in FoxBase days, even early FoxPro days, we used these functions a lot. We can’t remember the last time we used them, though. They return the cursor position on the screen and on the printer, respectively.

Usage

nCurScreenRow = ROW()
nCurScreenCol = COL()
nCurPrintRow = PROW()
nCurPrintCol = PCOL()

You can substitute $ for either ROW() or COL() in @ .. GET and @ .. SAY commands to specify the current location. ROW() and COL() do not respect the settings of ScaleMode, always reporting the row and column coordinates in foxels.

Example

@ROW(), COL()+1 SAY "Here's some information"

See Also

@…Get, @…Say, CurrentX, CurrentY