associates a term with a virtual file handle
INCLUDE 'msglib.h' new_handle(object,data(test),user_object,"OPEN OBJECT")
new_handle(VirtualHandle,Term,Type,ErrString) (i,i,i,i)
handle(VirtualHandle) (i) handle that is associated with term
void(Term) (i) term that becomes 'value' of VirtualHandle
atom(Type) (i) type of the handle
string(ErrString) (i) error message printed in case of misuse
Associates the VirtualHandle with the Term (e.g. real handle). Together with
handle_value
and
rem_handle
the user can use this to access his own data via virtual file handles. Type
may be any atoms except the predefined types file,window,btop.
Please also consult the description of
handle_value
.
new_file(my_data,"Hello World",user_string,"ADD DATA"). .... handle_value(my_data,X,"GET DATA"), write(X),nl. .... rem_handle(my_data,_,"LOSE DATA").
A runtime error occurs if an invalid handle is given.
prolog-process, client-server, object