opens a file for writing
INCLUDE 'iolib.h' openwrite(file,"filename")
openwrite(Handle,FileName) (i,i) (o,i)
handle(Handle) (i) virtual file handled which will be associated with the
file
void(Handle) (o) real file handle returned by the host
string(FileName) (i) name of the file to be opened
The file with the name FileName is opened writing only. An already existing it will be deleted first. It is referred to by the Handle, which may either be virtual or real.
openwrite(f,"test"), writedevice(f), write("Hello World"), writedevice(screen), closefile(f), file_str("test",Y), write(Y),nl.
No runtime errors. Fails if file could not be opened.
prolog-process, client-server, object
closefile , openread , openmodify , readdevice , writedevice , read , write