Skip to content

EXIT

Exit from Public Program

This directive causes a public program to pass back any CALL/ENTER variables and return to the CALLing program.

EXIT [error-value]
error-value
is an integer passed in the ERR variable to the CALLing program.

EXIT transfers program control to the program line that follows the originating CALL directive.

This directive can be used in Thoroughbred Basic Run Mode only.

If an error-value is specified in the EXIT directive it is treated as an error condition by the CALLing program resulting in an ERR=error-value at the CALL program line.

Pressing the Escape key while executing a public program that does not have a SETESC directive active results in an EXIT with ERR=39.

If an attempt is made to execute this directive in a program that is not a public program (a program that is RUN rather than CALLed), an ERR=27 results.

A public program can also be terminated by an END directive. This has the same effect as an EXIT that does not specify an error-value and does not pass any data to the CALLing program.

EXIT

returns program execution from the CALLed public program to the program line following the originating CALL directive.

EXIT 12

has the same effect as the first example but also sets the ERR system variable in the
CALLing program to 12 and causes an error condition in the CALLing program.

CALL, ENTER directives, and ERR system variable

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