BOF( ) Function Example

The following example opens the customer table and lists the company name one page at a time, starting with the last record in the table. The listing continues until the beginning of the file is reached or until you choose Cancel.

CLOSE DATABASES
CLEAR
OPEN DATABASE (HOME() + "samples\data\testdata")
USE customer
GO BOTTOM
local recCtr, btnValue
recCtr = 0
btnValue = 1
DO WHILE btnValue = 1 AND NOT BOF()
 ? "Company : " + company
 recCtr = recCtr + 1
 if (recCtr % 20) = 0 then
  btnValue =MESSAGEBOX ("Click OK to continue, Cancel to quit.",33)
  clear
 endif
 Skip -1    && Move up one record
ENDDO
=MESSAGEBOX("Listing complete.",48)