CHAROUT( )

Writes the string specified by >string into file >streamid after positioning on the character specified by parameter start. The number of remaining characters is returned. If streamid is not specified, the default output is used.

CHAROUT( [streamid] [, [string] [, start] ] )

The parameter start (positive number) can be specified to define the current position in the file before the write operation is processed. If start is not specified, the current position is not changed before the write process. Start is only valid for persistent streams. If start is specified for transient streams, an error is issued. The first character in the stream has the number 1.

During the first OPEN of the stream the write position is at the end of the stream, hence CHAROUT appends the characters at the end of the stream. If start is specified but not string, positioning only takes place at the new position. If neither string nor start have been specified, the stream will be closed.

Examples

CHAROUT(streamid,'Bye')	        /* Bye is added to the end of the stream */
CHAROUT(streamid,'Hello',1)	/* writes Hello at the stream beginning */
CHAROUT(streamid, ,6)		/* positions on character 6 */
CHAROUT(streamid)		/* closes the stream */