CLEAR
Clear Program Environment
This directive initializes certain program parameters. It accomplishes actions similar to BEGIN, but does not affect input/output channels. It is part of a series of similar directives including BEGIN, END, RESET, and STOP.
Syntax
Section titled “Syntax”CLEAR [EXCEPT variable-name [,variable-name...]]variable-name- is the name of a numeric or string variable. This variable is not cleared to 0 or null by the CLEAR directive.
Remarks
Section titled “Remarks”This directive:
- 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 close any files or devices.
- Does not set program execution pointer to the first program line.
- 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”CLEARaffects the program parameters as described above, setting all numeric variables to 0 and all string variables to null.
CLEAR EXCEPT STRING_1$, NUM_A, A1$, ARRAY(ALL)affects the program parameters as detailed above, but leaves STRING_1$, NUM_A, A1$, and ARRAY (numeric array) unchanged.
See also
Section titled “See also”BEGIN, 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