[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| EOF |
+---------------------------------+
EOF([<expN> | <expC>])
-----------------------------------
Determines if record pointer is positioned at end of database.
Return value - Logical
-----------------------------------
The EOF() function returns the logical value true (.T.) if the
end-of-file is reached. End-of-file occurs when the record pointer
passes the last logical record in the database or when a FIND, LOCATE or
SEEK command was unsuccessful. EOF() returns the logical value false
(.F.) if end-of-file has not been reached.
EOF() supports an optional argument <alias> which indicates the work
area to which the function is to be applied. Specify a database alias
or work area letter (work area letters A through J for the first ten
work areas only) or specify the work area number. If you specify an
alias or work area letter it must be enclosed in single or double
quotes.
If no database is open in the indicated work area, false is returned.
If the argument is omitted, the status of the currently selected work
area is returned.
Clauses
-------
<expN> | <expC>
Work area number or alias.
+---------------------------------+
| Program 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,65 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: BOF()
-----------------------------------
See Also:
BOF()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson