PUTCHAR/PUTC - output a character.

Alternate Entry Name: PUT.CH

Usage:

B:
   char = putchar( char );
   char = putc( unit, char );
/* C users use C "putchar", "fputc", etc. */

Where:

char
is a word containing a nine-bit ASCII character. Actually, PUTCHAR and PUTC will output as many non-zero characters as there are in the word, but there are a number of reasons why you should usually only write out one at a time.
unit
is the number of any open output unit ("unit" is only allowed for PUTC, not PUTCHAR.)

Description:

PUTCHAR writes its argument out to the current write unit and returns its argument to the caller. Except for Media-4 files, PUTCHAR does nothing with a word containing only a '*0', so you can say something like

while( putchar( getchar() ) );

For a Media-4 file, the '*0' will be written to the file. The current write unit must be open as a character stream output unit; otherwise, the output vanishes.

With PUTC, you must specify a unit. PUTC returns the character it wrote out.

Copyright © 1996, Thinkage Ltd.