CHAROUT (Character Output) Function

The CHAROUT function writes single-byte characters. The format is:
Read syntax diagramSkip visual syntax diagramCHAROUT( name ,string, start )
where:
name
is the name of the stream to which the character is written
string
is a string of characters to write
start
is the starting position of a stream of characters.

Like the LINEOUT function, CHAROUT returns 0 if all the characters in the string (string) are successfully written to the file (name). Unlike LINEOUT, if for any reason CHAROUT cannot write to the named file (name), it returns the number of characters that remain unwritten.

CHAROUT is also similar to LINEOUT in that it is more convenient to call it as a subroutine.

The first time a program uses CHAROUT, the named stream is opened for writing and the characters are written to the end of the stream. If the write pointer is moved (using LINEOUT or STREAM), CHAROUT will write over existing data in the line. The start value for CHAROUT must be 1 (default value). CHAROUT will always start with the first character in the line.