9. Special files and Locking Variables

The purpose of the Special files is to inform StrongBS what variables should not be renamed. A special file is a text file with a list of variable names.

Variables may be locked against renaming using one of two methods:

Using REM lines in the BASIC program

You can use a REMark line like this:

10 REM LOCK var1, var2, var3, .....

Using a Special file

The "Special File" is a text file that lists all variables and routine names that you don't want StrongBS to rename. The first word of the file should be the word "LOCK:" on a separate line. Following this, you list your variables. Please note that this is the word "LOCK" immediately followed by a colon.

When listing your variables, you can either list each variable on a separate line or separate them by commas.

You can use comments if you like using any of the following reserved characters # or \ or | anywhere in the Special file.

Here is an example:
Lock:
\The following variables are not to be renamed
menu_pointer%(
menu_string$(
menu_icon%
icon%,icon_flag%,icon_size%
\The following routines are not to be renamed
PROCcreate_menu
FNmenu_width

Note:
The Special file must always end with a blank line.

An array variable should be entered until the first opening bracket only. i.e. for pointer%() use pointer%(

You can separate variable names with a comma.

Automatic loading of Special files

This feature allows you to customize a special file for each one of your BASIC programs.

StrongBS will automatically search the current directory (from where the loaded BASIC program comes) for the Special file called "SBSMake" if it finds one, it will automatically load it in.

This feature can be enabled or disabled in the Choices dialog box.

You can tell that a Special file is loaded by observing the "Special file" indicator on StrongBS main window (next to the Squash button) which will show one of the following messages:

- "Loaded"
a Special file is loaded and will be used.
- "Not required"
a Special file is not required for this loaded BASIC program because it has no EVAL functions.
- "Required"
Some EVAL functions found but no Special file has been loaded.
Tokens used in a Special file
  1. Lock:

    The token "lock:" is followed by a list of variables and/or procedures or function names that you do not want StrongBS to rename. Variable names can be separated by commas or new lines.

    Example:

    Lock:
    menu_pointer%(
    menu_string$(
    menu_icon%
    icon%,icon_flag%,icon_size%

  2. 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 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

  3. 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

  4. 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.

  5. OutFile:

    This token specifies the name of the file to be used for the output file. This can be given as a leafname only filename like "MyFile" in which case it will be added to the original pathname of the source file. If it is given as a full pathname, then this is assumed as the new name of the file.

    You can use the <Obey$Dir> to point at the directory of the original source file.

    Examples:

    OutFile: !RunImage
    OutFile: ADFS::HardDisc.$.MyPrograms.!RunImage
    Outfile: <Obey$Dir>.!RunImage

  6. SBSLogFile:

    This token gives the name of the file to be used as a Log filename. This can be given as a leafname only filename like "LogFile" in which case it will be added to the original pathname of the source file. If it is given as a full pathname, then this is assumed as the new name of the log file.

    You can use the <Obey$Dir> to point at the directory of the original source file.

    The full pathname of the log file will be displayed in the Main window.

    Examples:

    SBSLogFile: LogFile
    SBSLogFile: ADFS::HardDisc.$.TempDir.MyLog
    SBSLogFile: <Obey$Dir>.LogFile

  7. SBSOutFormat:

    This token gives the type of the output file. There are 3 types:

    1. BASIC: File is saved as a BASIC file.
    2. Absolute: File is saved as an Absolute file.
    3. Crunched: File is saved as a Crunched Absolute file.
    The Syntax of the token is:

    SBSOutFormat: [+]

    or in the abbreviated mode, you can use:

    SBSOutFormat: [+]

    the '+' sign will allow command line parameters to be preserved.

    Examples:

    SBSOutFormat: Basic \output BASIC type
    SBSOutFormat: B \output BASIC type
    SBSOutFormat: Absolute \output Absolute type
    SBSOutFormat: A \output Absolute type
    SBSOutFormat: Crunched \output Crunched absolute type
    SBSOutFormat: C \output Crunched absolute type
    SBSOutFormat: C+ \output crunched absolute+preserve command param.