[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|               BOF               |
+---------------------------------+
BOF([<expN> | <expC>])

-----------------------------------
Determines if record pointer is positioned at beginning of a database.
Return value - Logical
-----------------------------------

<expN> | <expC>
        Work area number or alias.  If a database is not open in the indicated
work area, false (.F.) is returned.  If the argument is omitted, the
status for the currently selected work area is returned.

+---------------------------------+
|            Example              |
+---------------------------------+
In this example, CUSTOMER database is opened and small window with push
buttons is displayed which allows you to move forward, move backward or
quit.  Once you make a choice, FoxPro moves record pointer or exits
program.  Depending on direction moved, FoxPro checks to see if record
pointer is at end of file (EOF) or at beginning of file (BOF).  If
either condition is true, FoxPro displays appropriate message and
repositions record pointer.

SET TALK OFF
CLEAR
USE customer
DEFINE WINDOW mskip FROM 9,10 TO 13,70 DOUBLE COLOR SCHEME 5
ACTIVATE WINDOW mskip
@ 1,5 GET mchoice FUNCTION '*HN \<Forward;\<Backward;\<Quit';
        DEFAULT 0 SIZE 1,14 VALID CHOICE()
READ CYCLE
RELEASE WINDOW mskip

PROCEDURE choice
        DO CASE
                CASE mchoice = 1
                        SKIP
                                IF EOF('CUSTOMER')
                                        WAIT WINDOW 'End of file encountered' NOWAIT
                                        SKIP -1
                                ENDIF
                CASE mchoice = 2
                                        SKIP -1
                                        IF BOF('CUSTOMER')
                                                WAIT WINDOW 'Beginning of file encountered' NOWAIT
                                                GO TOP
                                        ENDIF
                CASE mchoice = 3
                        CLEAR READ
        ENDCASE
ACTIVATE SCREEN
@ 2,1 SAY 'Company: '+ company
RETURN .T.

-----------------------------------

See Also:  EOF()

-----------------------------------

See Also: EOF()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson