[ Character I/O | Reference Manual | Alphabetic Index ]
put_char(+Stream, +Char)
Puts the single character text Char onto the buffered output stream Stream.
- Stream
- Stream handle or alias (atom)
- Char
- Single character string or atom.
Description
Puts the single-character string or atom Char onto the output stream Stream.
Modes and Determinism
Exceptions
- (4) instantiation fault
- Stream is not instantiated.
- (4) instantiation fault
- Char is not instantiated.
- (5) type error
- Stream is neither a stream handle nor an atom.
- (5) type error
- Char is instantiated, but not to a single character string or atom.
- (192) illegal stream mode
- Stream is not an output stream.
- (193) illegal stream specification
- Stream is an illegal stream specification.
Examples
Success:
?- put_char(output, "a").
a
yes.
?- put_char(output, '7').
7
yes.
?- put_char(output, a).
a
yes.
Error:
put_char(Stream,A). (Error 4).
put_char(output,ab). (Error 5).
put_char(output,98). (Error 5).
put_char(11, "a"). (Error 192).
put_char(atom, "a"). (Error 193).
See Also
get_char / 1, get_char / 2, put_char / 1, nl / 1