PROGRAM
Define Program File
This directive is used to create a new data file in a logical disk directory to contain an executable program.
Syntax
Section titled “Syntax”PROGRAM file-name, program-size, disk-num, sector-num[,ERR=line-ref|,ERC=error-code]file-name- is any string of 8 characters or fewer used to name the file and the program it contains.
program-size- is an integer in the range of 0 to 64000 specifying the number of bytes to be allocated for storage of the program file.
disk-num- specifies the logical disk directory that will contain the program file. Valid values are 0 through 35.
sector-num- is a required parameter. The only valid value is 0.
line-ref- is the program line number or label to branch to if this directive produces an error.
error-code- is a programmer-defined error code. Valid values are positive or negative whole numbers.
Remarks
Section titled “Remarks”Program-size values up to a maximum of 64000 are available starting with release level 8.0.
If any integer range is exceeded, an ERR=41 results.
If a program-name of more than 8 characters is specified, an ERR=10 results.
Program-name must be unique among filenames in the execution environment. An attempt to define a same-name that is defined on an available logical disk directory results in an ERR=12.
Use of the PROGRAM directive to allocate program file space on storage media does not normally establish any usable data in that file space. Any attempt to LOAD or RUN program-name after being defined by the PROGRAM directive, but before any actual program is SAVEd under that program-name, normally results in an ERR=19.
The PROGRAM directive is seldom used because the SAVE directive can create the file space.
Actual program file space allocated is rounded up to a multiple of 256 bytes. This corresponds to a concept of ‘pages’ of memory allocated in 256-byte pieces. (See the START directive.)
Examples
Section titled “Examples”PROGRAM "TEST", 750, 2, 0defines a program file named TEST, 750 bytes long, located in logical disk directory 2, starting at a sector allocated by the system.
PROGRAM I$, A, B, C, ERR=7999If I$ = “TEST”, A = 750, B = 2, C = 0, has the same effect as the first example and, in addition, branches to statement 7999 if the directive produces an error condition.
See also
Section titled “See also”From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF