TextFileClose
Previous
Top
Next
Prototype
TextFileClose
(intFileHandle)
Description
It closes text file.
Parameters
IntFileHandle
: integer value that corresponds to the handle of the file.
Returned value
None.
Notes
None.
Example
// It 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 writes the same string until doesn't reach end of file
While not TextFileEOF do
Begin
TextFileWriteln(UnFile,'Aldo Rossi');
End;
// It closes the file
TextFileClose(UnFile);