BEGIN
Begin Program Environment
This directive initializes certain program parameters. It is the most comprehensive in a series of similar directives that includes CLEAR, END, RESET, and STOP.
Syntax
Section titled “Syntax”BEGIN [EXCEPT variable-name [,variable-name...]]variable-name- is the name of a specific numeric or string variable. This variable is not cleared to 0 or null by the BEGIN directive.
Remarks
Section titled “Remarks”This directive:
- Closes all files and devices.
- Initializes all variable values to 0 or null except those listed in the EXCEPT clause.
- Clears the Return Address Stack (used to hold address values for certain directives, i.e., FOR/NEXT, RETURN, RETRY, etc.).
- Sets value of ERR and CTL to 0.
- Sets PRECISION to 2, ends FLOATING POINT.
- Sets SETERR and SETESC to 0.
- Does not set the program execution pointer to the first statement.
- Does not DROP public programs, which have been made resident by an ADDR directive.
- Does not DROP files, which have been added to the File Control Table by an ADD directive.
- Does not affect system variables such as TIM (Time) and DAY (Date).
- Does not terminate a SETTRACE directive.
Examples
Section titled “Examples”BEGINaffects the program parameters as detailed above, setting all numeric variables to 0 and all string variables to null.
BEGIN EXCEPT STRING_1$, NUM_A, A1$affects the program parameters as detailed above, but leaves STRING_1$, NUM_A$, and A1$ unchanged.
See also
Section titled “See also”CLEAR, END, RESET, and STOP directives
From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF