Make your own free website on
3.2.14. CHAROUT([streamid][,[string][,start]])

In general this function will write string to a streamid.  If
streamid is not specified the default output stream will be used.

If start is specified, the current write position will be set to
the startth character in streamid, before any writing is done.
Note that the current write position ca not be set for transient
streams, and attempts to do so will report an error. Independent
of any conventions that the operating system might have, the first
character in the stream is numbered 1. If start is not specified,
the current write position will not be changed before writing.

If string is omitted, nothing is written, and the effect is to set
the current write position if start is specified. If neither
string nor start is specified, the implementation can really do
whatever it likes, and many implementations use this operation to
close the file, or flush any changes. Check implementation
specific documentation for more information.

The return value is the number of characters in string that was
not successfully written, so 0 denotes a successful write. Note
that in many REXX implementations there is no need to open a
stream; it will be implicitly opened when it is first used in a
read or write operation.

(Assuming the file referred to by outdata was empty, it will
contain the string FoobWow afterwards. Note that there might will
not be an End-Of-Line marker after this string, it depends on the

     CHAROUT(, ‘Foobar’)      –>   ‘0’
     CHAROUT(outdata, ‘Foobar’)    –>   ‘0’
     CHAROUT(outdata, ‘Wow’, 5)    –>   ‘0’