Function Bof() Foundation

Determine whether the beginning of the file was reached.

Syntax
Bof() --> lBof
Return

The return value of Bof() is .T. (true) when an attempt has been made to move the record pointer within a work area in front of the first logical data record. Otherwise, .F. (false) is returned. When no file is open in the work area, the function returns .F. (false). When no data records are available, Bof() returns the value .T. (true).

Description

The database function Bof() determines whether the beginning of the file in a work area has been reached. Each work area has its own Begin-Of-File (BOF) status which is set to the value .T. (true) when an attempt is made to move the record pointer in front of the first logical record. In this case, the record pointer remains at the first logical record and Bof() returns the value .T. until the record pointer is moved. The BOF status can only be set to .T. by the command SKIP or the function DbSkip(). When the function is used without the alias operator, it returns the BOF status for the current work area.

Examples
Bof()
// In the example, two files are opened and the use 
// of Bof() is demonstrated with and without the 
// alias operator. 

PROCEDURE Main 
   USE Customer NEW 
   USE Invoice  NEW 
   ? Alias()                 // result: INVOICE 
   ? RecNo()                 // result: 1 
   ? Bof()                   // result:.F. 

   SKIP -1 
   ? RecNo()                 // result: 1 
   ? Bof()                   // result:.T. 

   GOTO RecNo() 
   ? RecNo()                 // result: 1 
   ? Bof()                   // result:.F. 

   Customer->(DbSkip(-1)) 
   ? Customer->(RecNo())    // result: 1 
   ? Customer->(Bof())      // result:.T. 

   CLOSE DATABASES 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.