The EndOfFile function returns TRUE if the end of the file is reached after a sequence of ReadLine calls while reading a file previously opened with OpenRead.
Syntax:
|
endReached = fileManager.EndOfFile( fileNumber )
|
Parameter:
|
Description:
|
fileNumber
|
The opened file-number identified by one of the Open file methods.
|
Example:
|
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: lineString Type: String
VARIABLES: fileNumber Type: Integer
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Open file for Read Only access.
fileNumber = fileManager.OpenRead( "C:\FileToOpen.txt" )
' When a file-number > 0 is available, . . .
If fileNumber > 0 THEN
' Loop reading lines until we reach the
' end of the file marker.
Do UNTIL fileManager.EndOfFile( fileNumber )
' Read a line from the current file.
lineString = fileManager.ReadLine( fileNumber )
' Print the line
PRINT lineString
LOOP
' Close the file.
fileManager.Close( fileNumber )
ENDIF ' fileNumber > 0
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Returns:
|
endReached is set to TRUE when the End-of-File marker is reached.
|
Edit Time: 9/12/2020 2:12:50 PM
|
|
Topic ID#: 279
|