
get_char(+Stream, -Char)

   Reads the next character from the input stream Stream

Arguments
   Stream              Stream handle or alias (atom)
   Char                Single character string or variable.

Type
   Character I/O

Description
   Takes a single character string from the input stream Stream.  and
   unifies it with Char.

   Note that this predicate returns a string, while the corresponding predicate
   iso:get_char/2 returns an atom!


Modes and Determinism
   get_char(+, -) is det

Exceptions
     4 --- Stream is not instantiated.
     5 --- Stream is neither a stream handle nor an atom.
     5 --- Char is instantiated, but not to a single character string.
   190 --- End of file has been reached.
   192 --- Stream is not open for reading.
   193 --- Stream is not a valid stream number.

Examples
   
   Success:
      ?- get_char(input,Char).
       a
      Char = "a"
      yes.

      ?- get_char(input, "b").
       b
      yes.

      ?- sh('cat file1').
      p
      yes.
      ?- open(file1, update,s),
         get_char(s,X).
      X = "p"
      yes.
Fail:
      ?- get_char(input, "b").
       a
      no.

Error:
      get_char(Stream, "b").             (Error 4).
      get_char(input, 'b').              (Error 5).
      get_char(input, 98.0).             (Error 5).
      get_char("string", Char).          (Error 5).
      get_char(null,Char).              (Error 190).
      get_char(9,Char).                 (Error 192).
      get_char(atom,Char).              (Error 193).





See Also
   get / 1, get / 2, get_char / 1, iso : get_char / 2, put / 1, put / 2, put_char / 1, put_char / 2
