[ Character I/O | Reference Manual | Alphabetic Index ]

get(-Code)

Reads the next character or byte from the current input stream
Code
Variable or integer.

Description

Takes the next character from the current input stream, and unifies its integer character code with Code. The range of possible values depends on the stream's text encoding, or is 0 to 255 for binary streams.

Character codes for the non-printable characters (i.e. control characters) are treated like normal characters.

On end-of-file, -1 is returned (via the default handler for event 190).

Modes and Determinism

Exceptions

(5) type error
Code is instantiated, but not to an integer.
(190) end of file reached
End of file has been reached.

Examples

   Equivalent to get(input, Code).  (see get/2 for details).

See Also

get / 2, put / 1, put / 2