The Lines function returns a how many lines remain to be read from an input stream, following the current read position.
Portability note: some implementations are unable to determine how many lines remain and return 1 when an undetermined number of lines remain, and 0 otherwise.
When the default input stream is associated with keyboard input, the number of lines remaining can not be determined.
result = Lines( [ stream ] ) |
Examples:
say Lines() -- shows how many lines can be read from the default input stream -- 0 or 1(indeterminate). say Lines( '' ) -- shows how many lines can be read from the default input stream -- 0 or 1(indeterminate). say Lines( 'file1' ) -- shows how many lines can be read from the stream named 'file1'
/* convert lines to uppercase * input is from the default input stream * output is to the default output stream */ do while Lines() > 0 call lineout , translate( linein() ) end |