Script functions reference > Script functions in alphabetical order > F > FileReadLn

FileReadLn
Syntax
FileReadLn(filename, var);
filename
var
Description
Reads a line from the specified file until a new line or an end of file is reached, and returns the line to a specified variable. The new line character is not included in the result. You must open the file to be read with FileOpen before calling FileReadLn. Use the FileClose function to close the file after reading.
Note:
Using FileReadLn with a file previously written by FileWrite in a job might cause errors due to the pre-processing phase (for more information on the pre-processing and processing phases, see Formatting phase).
Returns
A number indicating whether the line was successfully read.
0
>0
Failure. This value can be sent to IoErrText which will return an error text for the failure.
Example
while(filereadln(".\file.txt", $inbuf) = 0){
}
Reads from file.txt until EOF is reached.
OpenText StreamServe 5.6 Updated: 2013-03-01