RecNo()
This function returns the physical position number for a record. It also has an optional parameter that makes it part of FoxPro's "soft seek" process.
Usage |
nReturnValue = RECNO( [ cAlias | nWorkArea | nSoftSeek ] ) |
Parameter |
Value |
Meaning |
cAlias |
Character |
Return the record number in the table open as cAlias. |
Omitted |
If nWorkArea is also omitted, return the record number in the current work area. |
|
nWorkArea |
Numeric |
Return the record number in the table open in work area nWorkArea. |
Omitted |
If cAlias is also omitted, return the record number in the current work area. |
|
nSoftSeek |
0 |
Return the record number of the closest match to the last SEEK. |
Omitted |
Return the record number of the current record in the specified work area. |
Example |
USE Customer ? RECNO() && returns 1 SKIP 5 ? RECNO() && returns 6 * now check out softseek SET ORDER TO Company_Na SEEK 'CAESAR' ? FOUND() && returns .F. ? RECNO(0) && returns 13, which is "Centro comercial Moctezuma" * hold pointer position and return IF EOF() nCurrentRec=0 ELSE nCurrentRec=RECNO() ENDIF * do some processing IF nCurrentRec=0 GO BOTTOM SKIP ELSE GO nCurrentRec ENDIF |
See Also |