TextFileReadLn
Previous  Top  Next

Prototype

StrText:=TextFileReadLn (intFileHandle)

Description

It reads a string from a file until the first carriage return.

Parameters

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

Returned value

StrText: corresponds to the text string readed from 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');

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

// It reads a string from the file
text:=TextFileReadln(UnFile);

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

// It closes the file
TextFileClose(UnFile);