TextFileRead
Previous  Top  Next


Prototype

StrText:=TextFileRead (intFileHandle)

Description

It reads a text string from a file.

Parameters

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

Returned value

StrText: corresponds to the text string readed by the file.

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');

// Opens the file
UnFile:=TextFileOpen('c:\text\first.txt',false);

// Reads file contents
text:=TextFileRead(UnFile);

//It shows in a erasable by the user message the text of the file
ApplicationLog(_CurrentAgent,'text:' + text);

// Closes the file
TextFileClose(UnFile);