$value = Readline(filenumber)
reads a line of ascii data up to a carriage return character.
If you are at end of file then Readline returns -1.
(other errors are possible. eg file is open for output only)
Usually the following is all that is required
$value = ReadLine(1)
WHILE @Error = 0
; process line contents
$value = ReadLine(1)
LOOP
; file has been processed