Skip to content

CTL

Control Key Variable

This numeric system variable returns an integer value to an INPUT [EDT] or FINPUT directive as determined by keyboard editing keys and program function keys.

CTL

The following list displays the value of CTL for each key noted:

Function or Edit Key Value of CTL
Enter 0
F1 1
F2 2
F3 3
F4 4
F5 5
. . . . . .
Fn n
Cursor Arrow Right -1
Cursor Arrow Left -2
Cursor Arrow Down -3
Cursor Arrow Up -4
Backspace -5
Delete Character -6
Insert Character -7
Insert Line -8
Delete Line -9
Erase Line -10
Erase Page -11
Tab Forward -12
Tab Backward -13
Cursor Home -14
Ctrl-p -15
Page Down -16
Page Up -17
Screen Down -18
Screen Up -19
Boundary Down -20
Boundary Up -21
User Defined -22

Not every keyboard layout, monitor, or terminal has all these keys. Negative CTL values are sensed only by the INPUT directive with the EDT option. The corresponding key for a negative CTL generates its normal character sequence to the program for INPUT without the EDT option and READ directives without terminating the INPUT.

This system variable is numeric and may be used in numeric expressions.

Once set, the value remains unchanged until cleared to 0 by the next BEGIN, CLEAR, END, FINPUT, INPUT [EDT], LOAD, RESET, RUN, or STOP directive or until you go to Thoroughbred Basic Console Mode.

Keyboard keys, which generate a CTL value, also act as a pressed Enter key to terminate FINPUT and INPUT [EDT] directives.

If the only key pressed for an FINPUT or INPUT [EDT] directive is a CTL-generating key
no data is returned, only the appropriate value in CTL.

CTL values are matched to the keyboard characters for each terminal or monitor type sent in its associated configuration table in the files TCONFIG or TCONFIG8.

One special case of CTL occurs when an FINPUT or INPUT [EDT] uses the SIZ= option (see FINPUT and INPUT [EDT] directives) to ensure that the data does not exceed a specific number of bytes. If the operator attempts to enter more characters than specified by the SIZ= option, the FINPUT or INPUT [EDT] is terminated, the characters entered to that point are processed, and CTL is set to 5 to designate that the SIZ= option was exceeded.

When the PRM DEBUG=progname statement is specified in the IPLINPUT file and you use the Ctrl-B keystroke to interrupt program execution, progname will execute. When a debugging program exists, the interrupted Thoroughbred Basic program will continue to execute. The value of the CTL system variable is set to -99,999. For more information on the PRM DEBUG statement and the IPLINPUT file, please refer to the Thoroughbred Basic Customization and Tuning Guide.

LET X = CTL

If the F1 key was previously pressed, X is set to 1.

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