Eof()

Syntax

Eof([#]FileNumber)

Remarks

Determines whether the end of an open sequential file has been reached. FileNumber is the number specified in the Open instruction that opened the file for input. For more information about sequential files, see Chapter 9, "More WordBasic Techniques," in Part 1, "Learning WordBasic."

You cannot use this function to check for the end of a Word document open in a document window. To check for the end of a Word document, use the predefined bookmark "\EndOfDoc" with CmpBookmarks(). For more information about predefined bookmarks, see "Operators and Predefined Bookmarks" later in this part.

Eof() returns the following values.

Value

Explanation

–1

The end of the file specified by FileNumber has been reached.

0 (zero)

The end of the file has not been reached.


For an example, see Read.

See Also

Close, Input, Input$(), Line Input, Lof(), Open, Print, Read, Seek, Write