Skip to content

ESCON

Escape Trapping On

This directive enables program escape trapping specified by the SETESC directive and reverses the effects of the ESCOFF directive. The default condition when Thoroughbred Basic is initiated is the ESCON condition.

ESCON

The primary use of this directive is to reverse the effects of the ESCOFF directive that is used principally in debugging mode. This is normally not found in the program code itself, but is used in Thoroughbred Basic Console Mode to restore normal Escape key trapping that has been disabled with the ESCOFF directive.

00100 BEGIN
00110 SETTRACE
00120 SETESC 01000
00130 ESCOFF
00140 WAIT 100; REM "Press Escape key"
00150 ESCON
00160 WAIT 100; REM "Press Escape key again"
00200 ESCOFF
00210 SETESC 02000
00220 ESCON
00230 WAIT 100; REM "Press Escape key one more time"
01000 PRINT "Escape trapped at 01000"
01010 GOTO 00200
02000 PRINT "Escape trapped at 02000"

shows how this directive functions:

  1. Pressing the Escape key when line 00140 lists to the screen causes a program interruption and places you in Thoroughbred Basic Console Mode even though line 00120 had a SETESC directive.

2 Type RUN and press the Enter key. The program continues at line 00150, where the
ESCON directive turns on Escape key processing.

  1. Pressing the Escape key when line 00160 lists to the screen causes the program to branch to 01000, indicating that the SETESC is once again active and that the ESCOFF directive did not change the program line number or label set by the SETESC directive.
  2. Pressing the Escape key when line 00230 lists to the screen causes a branch to 02000, indicating that the SETESC directive at line 00210 (executed after the ESCOFF at line 00200) is still able to change the program line number for Escape key processing.

ESCOFF and SETESC directives

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