Skip to content

TERM-KEY

FUNCTION

This Script-IV variable interacts with the CHANGE TEXT, INPUT MESSAGE, INPUT SCREEN, and PRINT VIEW commands. TERM-KEY returns a numeric value corresponding to the key entered by the operator.

SYNTAX

TERM-KEY

NOTES

  • The TERM-KEY variable can be used in your script to control processing. When one of the keys is used to complete input to a field, the input can be processed in different ways depending upon which key the operator used to terminate the entry.

  • In an INPUT SCREEN or INPUT MESSAGE command, only termination keys and special keys return a value to TERM-KEY. Field edit keys, which are used to perform editing functions in these commands, do not affect the value of TERM-KEY.

  • In an INPUT [Thoroughbred Basic options] command, the TERM-KEY variable is not used. The value of a function key entered by the operator is returned to the Thoroughbred Basic CTL variable.

  • TERM-KEY can be used to specify the number of seconds allowed for data entry. Prior to anticipated input, set TERM-KEY to a negative integer value from -101 through -32867. The specified input time limit equals (TERM-KEY value + 100) * (-1) seconds.

    A time-out occurs when the time limit is exceeded. A time-out automatically terminates the input and sets TERM-KEY to a value of -99.

  • Please refer to the following chart for terminal keyboard values.

TERMINAL KEYBOARD VALUES (TERM-KEY)
E Field Edit Keys (edit and move within a field)
T Termination Keys (terminates input to a field)
C Field Control Keys (move between fields)
S Special Purpose Keys (performs a fixed function, cannot override)
Value Special Key Type (Function) Value Special Key Type (Function)
16 Function Key 16 T -05 Back Space E
15 Function Key 15 T -06 Character Delete E
14 Function Key 14 T -07 Character Insert E
13 Function Key 13 T -08 Line Insert T
12 Function Key 12 T -09 Line Delete T
E Field Edit Keys (edit and move within a field)
T Termination Keys (terminates input to a field)
C Field Control Keys (move between fields)
S Special Purpose Keys (performs a fixed function, cannot override)
Value Special Key Type (Function) Value Special Key Type (Function)
11 Function Key 11 T -10 Line Erase E
10 Function Key 10 T,C (Goto Field) -11 Page Erase T
09 Function Key 09 T -12 Tab E
08 Function Key 08 T -13 Back Tab E
07 Function Key 07 T -14 Home E
06 Function Key 06 S (Help) -15 Control P (None)
05 Function Key 05 T -16 Page Down T,C (Last Field)
04 Function Key 04 S (End) -17 Page Up T,C (First Field)
03 Function Key 03 T -18 Screen Down T
02 Function Key 02 T -19 Screen Up T
01 Function Key 01 T -20 Boundary Down T
00 Return/Enter T -21 Boundary Up T
-01 Right Arrow E -22 User Defined
-02 Left Arrow E -99 Input Time-out Occurred
-03 Down Arrow T,C (Next Field) -101 1-Second Input Time Limit
-04 Up Arrow T,C (Previous Field) -32867 32767-second input time limit

EXAMPLES

IF TERM-KEY = 1 THEN
LET VIEW-FLAG = "C"
RUN OVERLAY "4SSAMPL3"
ELSE
IF TERM-KEY = 4 THEN
LET INPUT-FLAG = "D"
ELSE
IF TERM-KEY = 2 THEN
LET CUST-CODE = "Cash", CUST-CONTACT = "CASH CUSTOMER"
ENDIF
ENDIF
ENDIF

SEE ALSO

CHANGE TEXT, INPUT MESSAGE, INPUT SCREEN, PRINT VIEW, and description of the CTL variable in the Thoroughbred Basic Language Reference

From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF