TextFileEOF

Top  Previous  Next

Prototype

 

BoolEnd:=TextFileEOF (intFileHandle)

 

Description

 

Checks if the end of a text file is reached.

 

Parameters

 

IntFileHandle: integer value that corresponds at the handle of the file.

 

Returned value

 

BoolEnd: logical value true or false. It returns true when reaches the end of file, otherwise returns false.

 

Notes

 

None.

 

Example

 

// Delete output file, if exists

DeleteFile('c:\text\output.txt');

 

// Create a new output empty file

CreateFile('c:\text\output.txt');

 

// Open output file for text writing

OutFile:=TextFileOpen('c:\text\output.txt',true);

 

// Open input file for text reading

InFile:=TextFileOpen('c:\text\output.txt',false);

 

// Repeat until is at end of input file

While not TextFileEOF(InFile) do

Begin

Line:=TextFileReadln(inFile);

TextFileWriteln(outFile,Line);

End;

 

// Close the input file

TextFileClose(inFile);

 

// Close the output file

TextFileClose(outFile);