For DBF tables, returns the current record number. For all other table types, returns a bookmark of the current position in a table.

Syntax

RECNO([<alias>])

<alias>

The work area you want to check.

Description

RECNO( ) returns the current record number of the table in the current or a specified work area, if that table is a DBF table. For all other table types, RECNO( ) behaves like BOOKMARK( ), returning a bookmark. If no table is open in the specified work area, RECNO( ) returns a value of 0.

If the record pointer is at end-of-file (past the last record in the table), RECNO( ) returns a value that is one more than the total number of records in the table. Therefore, RECNO( ) returns a value of 1 if there are no records in the table—RECCOUNT( ) would return zero.

The use of BOOKMARK( ) is recommended instead of RECNO( ). Besides returning a consistent data type with all tables, with BOOKMARK( ) you can bookmark the position at the end-of-file and GO back to it. Although RECNO( ) will return a record number for the end-of-file, you cannot GO to that record number, because there actually is no record with that number.

OODML

Use the Rowset object’s bookmark( ) method.