/
isEndOfFile

isEndOfFile

Description

Use this command to determine whether you are at the end of a file. This is useful when you are reading in a file and want to know if you have finished reading all the contents or gotten to the end.

readXXXX commands performed when at the end of a file will fail, causing your script to fail, so it is good practice to call this command often when reading a file.

Functional area

Disk I/O

Command syntax

Syntax

isEndOfFile fileID

Arguments

Name Type Required Comments
fileID int
ID of file previously opened with fileOpen

Flags

None

Return value

boolean

Examples

int $fileID;
// Obtain file ID earlier do some operation to the file
// ...
while( `isEndOfFile` == false )
   { 
   // Read in something
}

Additional information

Related commands