BAP Online Manuals : Library Reference : Library by Name : writedevice
Previous: write
Next: xcall

6.2.140. writedevice

sets or returns the current output stream

SYNOPSIS

INCLUDE 'iolib.h'
writedevice(file)

SYNTAX

writedevice(Handle) (i)

ARGUMENTS

handle(Handle) (i) Handle of file to be set

DESCRIPTION

Sets the current output stream to the destination associated with Handle. Handle has to be obtained or initialised by a call to either openwrite , openmodify , or makewindow , or must be one of the predefined file handles stdout or screen. If handle is unbound, the handle of the current output stream is returned.

EXAMPLE

writedevice(Old),
openwrite(f,"test"),
writedevice(f),
write("Hello World"),nl,
writedevice(Old),
closefile(f),
file_str("test",X),
write(X),nl.

ERRORS

A runtime error occurs if the handle is invalid.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

openwrite , openmodify , write ,

display , put


BAP Online Manuals : Library Reference : Library by Name : writedevice
Previous: write
Next: xcall