Calling Program #2

The following calling program invokes OBJECT/SAMPLE/DYNAMICLIB, the library described previously:

BEGIN
   LIBRARY MYLIB(TITLE="OBJECT/SAMPLE/DYNAMICLIB.");
   INTEGER PROCEDURE FAKTORIAL(N);
   INTEGER N;
      LIBRARY MYLIB(ACTUALNAME="FACT");
   PROCEDURE DAYTIME(A,W);
   ARRAY A[*];
   INTEGER W;
      LIBRARY MYLIB;
   REAL T;
   ARRAY DATIME[0:120];
   MYLIB.LIBPARAMETER := "WITH TIME";
   REPLACE POINTER(DATIME[0],8) BY
      " 13 FACTORIAL IS ",
      FAKTORIAL(13) FOR 12 DIGITS,
      "     -     ";
   DAYTIME(DATIME[*],40);
   DISPLAY(DATIME[0]);
END.

In this program, the declaration of the library entry point FAKTORIAL specifies that the ACTUALNAME of the entry point is FACT. In the template built for the library MYLIB, the name of this entry point is FACT, so for linkage to occur, the directory of the library OBJECT/SAMPLE/DYNAMICLIB must contain an entry point named FACT. However, within the program, the entry point is referred to as FAKTORIAL.