The Lineout function attempts to write a sequence of characters as a line to an output stream and returns how many lines remain to be written. When all characters are written 0 is returned, otherwise 1 is returned.
When all characters could not be written the NOTREADY condition is raised.
CAUTION: in some environments a Lineout request may erase all existing data in the stream.
result = Lineout( [ stream ] [, [ string ] [, line# ] ] ) |
When the line# argument is absent, text is written to the current write position associated with the stream. The write position is the offset where a prior Charout or Lineout request completed. Initially the write position is the end of the output stream.
When the string and line# arguments are both omitted, the stream is CLOSED and 0 is returned.
When the string argument is omitted, and the line# arguments is present the current write position of the stream is set to the specified line number, and 0 is returned.
Examples:
say Lineout( , 'Howdy' ) -- writes the text to the default output stream, and returns the number of lines remaining to be written -- 0 or 1. say Lineout( '', 'Shazam' ) -- writes the text to the default output stream, and returns the number of lines remaining to be written -- 0 or 1. say Lineout( '', 'Abracadabra', 3 ) -- writes the text to the default output stream, at the 3rd line number, and returns the number of lines remaining to be written -- 0 or 1. say Lineout( 'file1', 'Shazam' ) -- writes the text to the stream named 'file1', and returns the number of lines remaining to be written -- 0 or 1. say Lineout( 'file1', , 3 ) -- sets the write position of the stream named 'file1' to the 3rd line position, and returns 0 say Lineout( 'file1' ) -- closes the stream named 'file1', and returns 0 |