Skip to content

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.

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.

This directive:

  1. Closes all files and devices.
  2. Initializes all variable values to 0 or null except those listed in the EXCEPT clause.
  3. Clears the Return Address Stack (used to hold address values for certain directives, i.e., FOR/NEXT, RETURN, RETRY, etc.).
  4. Sets value of ERR and CTL to 0.
  5. Sets PRECISION to 2, ends FLOATING POINT.
  6. Sets SETERR and SETESC to 0.
  7. Does not set the program execution pointer to the first statement.
  8. Does not DROP public programs, which have been made resident by an ADDR directive.
  9. Does not DROP files, which have been added to the File Control Table by an ADD directive.
  10. Does not affect system variables such as TIM (Time) and DAY (Date).
  11. Does not terminate a SETTRACE directive.
BEGIN

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

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