[ ECLiPSe Term-based I/O built-in.|Group Index| Full Index]

writeln(+Stream, ?Term)

The term Term is written on the output stream Stream according to the current operator declarations. Equivalent to write(Stream,Term), nl(Stream).

+Stream
Integer (stream number) or Atom (reserved or user-defined symbolic stream name).
?Term
Prolog term.

Description

Used to write the term Term (followed by a newline) on the output stream Stream according to the current operator declarations.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Stream is not instantiated.
(5) Type error
Stream is not an atom or an integer.
(192)
Stream is not an output stream.
(193)
Stream is an illegal stream specification.

Examples


   Success:
      [eclipse]: open(file1,update,s), writeln(s, X + 2),
      > writeln(s, Y + 3), close(s).
      X = _g90
      Y = _g78
      yes.
      [eclipse]: sh('cat file1').
      _g90 + 2
      _g78 + 3
      yes.

Error:
      writeln(S, a(b,c)).        (Error 4).
      writeln("string", a(b,c)). (Error 5).
      writeln(9, X + 2).         (Error 192).
      writeln(atom, X + 2).      (Error 193).


See Also

writeln / 1, write / 1, write / 2