The following calling program invokes the dynamic library OBJECT/FILEMANAGER/LIB previously described. In this example, the user has set the LIBPARAMETER attribute to MYFILE, which is the name of the file to be accessed. At library linkage time, which occurs during the call on READFILE, the library procedure SELECTION is invoked. All links to the library's entry points are resolved during linkage. Changes to the library attributes are ignored after linkage is made. However, the program can delink from the library and change the library attributes before any relinking.
BEGIN
LIBRARY L (TITLE="OBJECT/FILEMANAGER/LIB.");
PROCEDURE READFILE;
LIBRARY L;
PROCEDURE WRITEFILE;
LIBRARY L;
L.LIBPARAMETER := "MYFILE";
READFILE; % LINKAGE IS MADE
CANCEL(L); % LINKAGE IS BROKEN
L.LIBPARAMETER := "OTHERFILE"; % LIBPARAMETER CAN BE CHANGED
% BECAUSE THE LIBRARY HAS BEEN
% CANCELED.
WRITEFILE; % LINKAGE IS MADE AGAIN AND NEW
% VALUE OF LIBPARAMETER IS USED
END.
