Returns the current record number in the current or specified table.
Syntax
RECNO([nWorkArea | cTableAlias])
Returns
Numeric
Arguments
nWorkArea
Specifies the work area number for a table open in another work area. RECNO( ) returns 0 if a table isn't open in the work area you specify.
cTableAlias
Specifies the table alias for a table open in another work area.
Remarks
The current record is the record on which the record pointer is positioned.
RECNO( ) returns negative numbers for records appended in a table buffer.
RECNO( ) returns a value that is one greater than the number of records in the table if the record pointer is positioned beyond the last record in the table. RECNO( ) returns 1 if the record pointer is positioned before the first record in the table or the table has no records. If a table has no records, EOF( ) always returns true (.T.).
RECNO( ) issued without the optional arguments nWorkArea or cTableAlias returns the current record number for the table in the currently selected work area.
If you have issued SEEK unsuccessfully in an indexed table, you can specify 0 for nWorkArea to use "soft seek" logic to return the record number of the closest matching record. RECNO(0) returns 0 if a close match cannot be found. Visual FoxPro generates an error message if you issue GO RECNO(0) when a close match isn't found.