
get(+Stream, -Code)

   Reads the next character from the input stream Stream

Arguments
   Stream              Stream handle or alias (atom)
   Code                Variable or integer.

Type
   Character I/O

Description
   Takes the next character from the input stream 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
   get(+, -) is det

Exceptions
     4 --- Stream is not instantiated.
     5 --- Stream is neither a stream handle nor an atom.
     5 --- Code is instantiated, but not to an integer.
   190 --- End of file has been reached.
   192 --- Stream is not an input stream.
   193 --- Stream is an illegal stream specification.

Examples
   
Success:
      ?- get(input, X).
       a
      X = 97
      yes.

      ?- get(input, 0'a), get(input,97).
       aa
      yes.
Fail:
      ?- get(input,98).
       a
      no.
Error:
      get(Stream,98).                 (Error 4).
      get(input, '98').               (Error 5).
      get(10,A).                      (Error 192).
      get(atom,A).                    (Error 193).


See Also
   get / 1, put / 1, put / 2
