readLine

Syntax

readLine(handle)

Arguments

handle is the handle of the file to read.

Examples

Read a line from the given file. The return line doesn't include the line delimiter. If the file reaches the end, the function will return a null object which can be tested by the isNull function.

Examples

x=`IBM`MSFT`GOOG`YHOO`ORCL;
eachRight(writeLine, file("test.txt","w"), x);
// output: [1,1,1,1,1]

 fin = file("test.txt")
 do{
 x=fin.readLine()
 if(x.isNull()) break
 print x
 }while(true);

/* output:
IBM
MSFT
GOOG
YHOO
ORCL
*/

Related function: writeLine