LOAD
Load Program into Memory
This directive transfers a copy of a program from a logical disk directory into task memory without changing the status of any channels or variables.
Syntax
Section titled “Syntax”LOAD program-name [, PWD=passwd]LOAD trigger-definition-list [, PWD-passwd] [,OPT="IOT"]program-name- is any string of 8 characters or fewer used to name the program to be LOADed.
trigger-dictionary-list- is a string of 8 characters or fewer used to name the trigger definition to activate. For more information see the 3GL Trigger section of the Basic Developer Guide
passwd- (password) is any string in the range of 4 to 8 characters in length specifying the password that was used to ENCRYPT or PSAVE the specified program.
OPT="IOT"- is the keyword that indicates to Basic that this is a Trigger List.
Remarks
Section titled “Remarks”If a program is loaded without error, the system:
- Clears the task program memory area (not data or I/O memory area).
- Performs a RESET function:
- Clears the return address stack
- Sets ERR and CTL to 0
- Sets PRECISION to 2
- Sets SETERR and SETESC to 0
- Loads a copy of the program from disk storage into the task program memory area.
- Positions the program execution pointer to the first statement.
- Does not execute the program.
- Does not clear task variables.
- Does not close files or devices.
If an attempt is made to LOAD a program-name that cannot be found on any available logical disk directories, an ERR=12 results, and the current program memory area remains unchanged.
If an attempt is made to LOAD a program-name, and the LOAD contains the PWD= clause with a password that is not the correct password, an ERR=18 results.
If an attempt is made to LOAD a program-name that specifies a file that is not a program file, an ERR=17 results.
If an attempt is made to LOAD a program which has an invalid size (too small or too large), an ERR=19 results. This is normally an indication that the program file specified by program-name has been incorrectly altered by some method other than a normal ENCRYPT, PSAVE, or SAVE directive.
This directive is a Thoroughbred Basic Console Mode directive and should not be used in Thoroughbred Basic Run Mode.
Examples
Section titled “Examples”LOAD "INDEX"loads the program named “INDEX”.
LOAD P$If P$ = “INDEX”, has the same effect as the first example.
See also
Section titled “See also”RUN directive
From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF