10. Automatic linking of Library files and procedures



StrongBS can automatically link any number of library files to the main core BASIC program and will automatically remove any unused procedure and/or function in the library file(s). It can also remove any reference to the LIBRARY call in the main core BASIC program if told so.

To link the library files, you will need to tell StrongBS the names of the library files. If your library files are inside a directory and all the BASIC library files in that directory are to be linked then you could just tell StrongBS the name of the library directory.

To do all of this you need to give the commands to StrongBS through a "make" file. The make file must be named "SBSMake" and located in the same directory as the main core BASIC program.

When the core BASIC program is loaded into StrongBS, StrongBS automatically scans the directory for the text file called "SBSMake" and will process the file if found.

StrongBS provides 3 commands to manipulate LIBRARY files. These commands are used in the "SBSMake" file and are also known as tokens:

  1. SBSLinkDir:

    The token "SBSLinkDir:" is followed by a directory pathname that contains BASIC Library files that you want StrongBS to link to the current BASIC program. **ALL** BASIC files contained in the directory will be linked to the main program. If you want, say, only one or two files then use the "SBSLinkFile:" token instead.

    Only one Link Directory is looked up by StrongBS.

    Example:

    SBSLinkDir: <Obey$Dir>.MyLib

  2. SBSLinkFile:

    The token "SBSLinkFile:" is followed by a list of filenames that StrongBS will link to the current BASIC program.

    Example:

    SBSLinkFile:
    <Obey$Dir>.WimpLib
    <Obey$Dir>.Lib.GenLib
    <Obey$Dir>.Lib.DrawLib
  3. SBSRemoveLIBCall:

    This token allows you to automatically remove any reference to any LIBRARY call in the main program automatically. To do this the token must be followed by the variable "Yes" as follows:

    SBSRemoveLIBCall: Yes

    You can enable the automatic removal of LIBRARY calls in the "Choices" dialog box, so that StrongBS will automatically remove LIBRARY calls if an "SBSMake" file is loaded that contained Link files or a link directory.

    Note:
    When specifying the pathname for a LinkFile or a LinkDirectory you may use the variable <Obey$Dir>. This variable will be evaluated by StrongBS itself to mean the directory that contains the main BASIC program.