LINEOUT

 ──LINEOUT(─┬──────┬──┬─────────────────────────┬─)─────
              └─name─┘  └─,─┬────────┬──┬───────┬─┘
                            └─string─┘  └─,line─┘

LINEOUT returns the count of lines remaining after attempting to write string to the character output stream name. The count is either 0 (meaning the line was successfully written) or 1 (meaning that an error occurred while writing the line). string can be the null string, in which case only the action associated with completing a line is taken. LINEOUT adds a line-feed and a carriage-return character to the end of string.

The form of the name is implementation dependent. If name is omitted, the line is written to the default output stream, STDOUT: (normally the display) in OS/2.

For persistent streams, a write position is maintained for each stream. In the OS/2 operating system, this is the same as the read position. Any write to the stream starts at the current write position by default. Characters written by a call to LINEOUT can be added to a partial line. LINEOUT conceptually terminates a line at the end of each call. When the write is completed, the write position is set to the beginning of the line following the one just written. The initial write position is the end of the stream, so that calls to LINEOUT normally append lines to the end of the stream.

You can set the write position to the first character of a persistent stream by giving a value of 1 (the only valid value) for line.

┴╓: In some environments, overwriting a stream using CHAROUT or LINEOUT can erase (destroy) all existing data in the stream. This is not, however, the case in the OS/2 environment.