Description: Pascal II: Using Library Name Files Header: Pascal II: Using Library Name Files Many people have trouble using Library Name Files in Apple II Pascal (v.1.2 and 1.3 ). Here is a short explanation on what library name files are, and how they are used in Pascal. Library Name files, which contain the names of libraries to be used when running a program, are designed for very large applications, or for multiple program applications that need to use the same libraries. With small applications, when you want to use a library other than the system library, you can link your libraries ( as regular units ) directly into your program. For larger applications, however, this is impracticable, since each re-compilation makes linking more difficult and cumbersome. The solution for larger applications is to create Program Libraries which allow you to build your own set of intrinsic units without having to place them in the system library. (Intrinsic units have the same root name as the program, but have the suffix '.LIB' on the end; e.g., a program named TRYIT.CODE becomes TRYIT.LIB). What Library Name files do is allow you to handle up to five Program Library files for each program. To use Library Name files, write your library code and program code in the standard way. Each library unit MUST be an intrinsic unit. When writing your program you must remember to use the "$U ..." option to tell the compiler where to find your libraries interface (program library names are used only at execution time.). After compiling your library units, don't forget to use the LIBRARY program to place a library header in the file. Now, just compile your program and create your library name file. When you execute, your program will find its units even though you did not have to link them in. Here are three sample files that illustrate the process: Main program source code [TRYIT.TEXT]: PROGRAM USEWALLY; USES {$U WALLY.LIB} WALLY; BEGIN DOWALLY; END. Wally, library unit source code [WALLY.TEXT]: UNIT WALLY; INTRINSIC CODE 17 DATA 18 INTERFACE VAR WALLSTR:STRING[80]; PROCEDURE DOWALLY; IMPLEMENTATION PROCEDURE DOWALLY; BEGIN WRITELN('WELL WALLY WORKS WELL I THINK'); END; BEGIN END. Library name file [TRYIT.LIB]: LIBRARY FILES: WALLY.LIB $$ To build this program, you must compile the library unit first, then use LIBRARY to turn it into a library (with the proper header). Finally, compile the main program ( TRYIT.TEXT) and then run it to be sure that it works. Keywords: