Skip to content

SETESC

Set Escape Branch

This directive transfers program execution to the specified program line number or label when the Escape key is pressed. The statement being processed when the key was pressed is completed, with the exception of an I/O to the task’s terminal, which is interrupted.

SETESC line-ref
line-ref
is the program line number or label to branch to if the Escape key is pressed during execution.

The occurrence of a RETURN directive transfers program execution back to the statement following the statement that was being executed when the Escape key was pressed.

This directive is not cleared or reset to 0 when it is executed (as opposed to the SETERR directive).

A SETESC 0 returns the normal action of the Escape key. The most recent SETESC specified completely overrides any previous setting.

This directive is reset to 0 when a BEGIN, CLEAR, END, LOAD, RESET, RUN, or STOP directive is executed.

There is no relationship between the SETESC and ESCAPE directives, i.e., the ESCAPE directive is not trapped by the SETESC directive.

Starting with release level 8.0, pressing the Escape key sets the ERR system variable to 127.

SETESC 08500

If the Escape key is pressed at any time during the program, execution is transferred to statement 08500.

ESCOFF, ESCON, RETRY, RETURN, and SETERR directives
ERR system variable

From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF