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.
Disk I/O
readLine fileID |
Name | Type | Required | Comments |
---|---|---|---|
fileID | int | ID of file previously opened with fileOpen |
None
string
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;
}