TextFileEOF
Previous  Top  Next

Prototype

BoolEnd:=TextFileEOF (intFileHandle)

Description

It 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

// Check if a file exists 
Esistente:=FileExists ('c:\text\first.txt');

// If it doesn't exist it creates it 
If Esistente=False Then CreateFile('c:\text\first.txt');

// It opens the file
UnFile:=TextFileOpen('c:\text\first.txt',true);

// It initializes a variable
pos:=0;

// Writes same string until doesn't reaches the end of file
While (not TextFileEOF(UnFile)) do
Begin  
// Writes a string in the file  
TextFileWrite(UnFile,'Aldo Rossi');  
End;  

// It closes the file
TextFileClose(UnFile);