CHAROUT

 ──CHAROUT(─┬──────┬──┬──────────────────────────┬─)─────
              └─name─┘  └─,─┬────────┬──┬────────┬─┘

                            └─string─┘  └─,start─┘

CHAROUT returns the count of characters remaining after attempting to write string to the character output stream name. The form of the name is implementation dependent. If name is omitted, characters in string will be written to the default output stream, STDOUT: (normally the display) in the OS/2 operating system. string can be the null string, in which case no characters are written to the stream and 0 is always returned.

For persistent streams, a write position is maintained for each stream. In the OS/2 implementation, this is the same as the read position. Any write to the stream starts at the current write position by default. When the write is completed the write position is increased by the number of characters written. The initial write position is the end of the stream, so that calls to CHAROUT normally append to the end of the stream.

A start value can be given to specify an explicit write position for a persistent stream. This write position must be a positive whole number within the bounds of the stream (though it can specify the character position immediately after the end of the stream). A value of 1 for start refers to the first character in the stream.

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