Vicon Shogun banner

Description

Use to read a whole line of text from a file. Will read up until a newline character is encountered, or until 1024 characters have been read, whichever comes first.

Command will fail if at the end of the file.

Functional area

Disk I/O

Command syntax

Syntax

readLine fileID

Arguments

NameTypeRequiredComments
fileIDint
ID of file previously opened with fileOpen

Flags

None

Return value

string

Examples

string $line;
int $fileID;
// Open a sample text file
$fileID = `fileOpen "c:/samplefile.txt" "r"`;

// Keep reading in lines from the file
while( `isEndOfFile $fileID` == false )
{
$line = `readLine $fileID`;
// Do something with line
print $line;
}

Additional information

Related commands