Read a file one line at a time,
as opposed to reading the entire file at once.



Related tasks

 Read a file character by character
 Input loop.


4096 constant max-line
 
: third ( A b c -- A b c A )
  >r over r> swap ;
 
: read-lines ( fileid -- )
  begin  pad max-line third read-line throw
  while  pad swap  ( fileid c-addr u )  \ string excludes the newline
         2drop
  repeat 2drop ;