set_output(@stream_or_alias) [ISO]

This predicate sets the current output stream, stream predicates like put_byte/1 use the current output stream. The stream must not be an input stream.

see also: at_end_of_stream/0 at_end_of_stream/1 close/1 close/2 close_user_streams/0 current_input/1 current_output/1 flush_output/0 flush_output/1 open/3 open/4 prolog I/O set_input/1 set_stream_position/2 set_stream_property/2 stream_property/2

Example
set_output(user_out). if there is an output stream called 'user_out' then the current stream becomes 'user_out'

 

Exceptions  
stream_or_alias is a variable an instantiation_error exception is thrown
stream_or_alias is neither a variable nor a stream term nor an alias a domain_error(stream_or_alias, Stream) exception is thrown, the variable Stream is assigned the incorrect stream_or_alias term
stream_or_alias is not associated with an open stream an existence_error(stream, Stream) exception is thrown
stream_or_alias is an input stream a permission_error(output, stream, Stream) exception is thrown

 

 

info@trinc-prolog.com