sets or returns the current input stream
INCLUDE 'iolib.h' readdevice(file)
handle(Handle) (i) Handle of file to be set
Sets the current input stream to the source associated with Handle. Handle has to be obtained or initialised by a call to either openread , openmodify , or makewindow , or must be one of the predefined file handles stdin or keyboard. If handle is unbound, the handle of the current input stream is returned.
file_str("test","Hello World"), readdevice(Old), openread(f,"test"), readdevice(f), readln(X), readdevice(Old), closefile(f), write(X),nl.
A runtime error occurs if the handle is invalid.
prolog-process, client-server, object
openread , openmodify , read , readchar , readln , get , see