Skip to content

END

End Program Execution

This directive terminates a program and initializes certain program parameters.

END

The exact effects of this directive are:

  1. Does not alter the value of variables.
  2. Clears the Return Address Stack (used to hold address values for certain directives, i.e., FOR/NEXT, RETURN, RETRY, etc.).
  3. Sets value of ERR and CTL to 0.
  4. Sets PRECISION to 2, ends FLOATING POINT.
  5. Sets SETERR and SETESC to 0.
  6. Closes any files or devices.
  7. Sets program execution pointer to the first program line.
  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. Terminates any SETTRACE directive.

Every program contains an implicit END directive beyond the highest valid line number (i.e., at program line 65535). This means that when execution is completed, an END directive is performed even though an END directive does not explicitly appear in the program. Note that for systems that allow 9999 as the highest program line number, the implicit END directive occurs at program line 10000.

BEGIN, CLEAR, MERGE, RESET, and STOP directives

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF