EOF( )
Topic group Related topics Example
Indicates if the record pointer is at the end-of-file.
Syntax
EOF([<alias>])
<alias>
The work area to check.
Description
EOF( ) returns true when the record pointer in the current or specified work area is positioned past the last record; otherwise it returns false. If you attempt to navigate forward when EOF( ) is true, an error occurs.
When you first USE a table, EOF( ) is true if the table is empty, or you are using a conditional index with no matching records.
Many operations leave the record pointer at the end-of-file when they are complete or when they fail. For example, EOF( ) returns true after SCAN processes the last record in a table, when you use SKIP to pass the last record in a table, when you use LIST with no options, or when SEEK( ) or SEEK fails to find the specified record (and SET NEAR is OFF).
The position at the end-of-file is sometimes referred to as the phantom record. When you get the values of the fields at the phantom record, they are always blank. Attempting to REPLACE field values in the phatom record causes an error.
If no table is open in the specified work area, EOF( ) returns false.
OODML
The Rowset object’s endOfSet property is true when the row pointer is past either end of the rowset. Unlike BOF( ) and EOF( ), there is symmetry with the endOfSet property. You can determine which end you’re on based on the direction of the last navigation.
There is also an atLast( ) method that determines whether you are on the last row in the rowset, the row before EOF( ).