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);
[1,1,1,1,1]
$  fin = file("test.txt")
$  do{
$  x=fin.readLine()
$  if(x.isNull()) break
$  print x
$  }while(true);

IBM
MSFT
GOOG
YHOO
ORCL

Related function: writeLine