beautypg.com

Compaq COBOL AAQ2G1FTK User Manual

Page 415

background image

Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms

11.2 Designing Video Forms with ACCEPT and DISPLAY Statement Extensions

Example 11–10 Using the CONTROL KEY IN Phrase

IDENTIFICATION DIVISION.
PROGRAM-ID.

SPECIAL.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.

SYMBOLIC CHARACTERS

CR-VAL

CSI-VAL

Ctrl-Z-VAL

SS3-VAL

TAB-VAL

ESC

ARE 14

156

27

144

10

28.

DATA DIVISION.
WORKING-STORAGE SECTION.
*
*

The code returned will be the same regardless of

*

terminal type.

*
01 CONTROL-KEY.

02

FIRST-CHAR-CONTROL-KEY

PIC X.

88 CR

VALUE CR-VAL.

88 CSI

VALUE CSI-VAL.

88 Ctrl-Z

VALUE Ctrl-Z-VAL.

88 SS3

VALUE SS3-VAL.

88 TAB

VALUE TAB-VAL.

02

REMAINING-CHAR-CONTROL-KEY PIC XXXX.

88 UP-ARROW

VALUE "A".

88 DOWN-ARROW

VALUE "B".

88 RIGHT-ARROW

VALUE "C".

88 LEFT-ARROW

VALUE "D".

88 PF1

VALUE "P".

88 PF2

VALUE "Q".

88 PF3

VALUE "R".

88 PF4

VALUE "S".

88 AUX0

VALUE "p".

88 AUX1

VALUE "q".

88 AUX2

VALUE "r".

88 AUX3

VALUE "s".

88 AUX4

VALUE "t".

88 AUX5

VALUE "u".

88 AUX6

VALUE "v".

88 AUX7

VALUE "w".

88 AUX8

VALUE "x".

88 AUX9

VALUE "y".

88 AUXMINUS

VALUE "m".

88 AUXCOMMA

VALUE "l".

88 AUXPERIOD

VALUE "n".

88 AUXENTER

VALUE "M".

PROCEDURE DIVISION.
P0.
*
* DISPLAY ESC "=" puts you in alternate keypad mode
*

DISPLAY ESC "=".
DISPLAY " "

ERASE SCREEN.

P1.

DISPLAY "Press a directional arrow, PF, Return, Tab,

"

LINE 3 COLUMN 4.

DISPLAY "or auxiliary keypad key (Ctrl/Z stops loop)"

LINE 4 COLUMN 4.

ACCEPT CONTROL KEY IN CONTROL-KEY AT END GO TO P2.

(continued on next page)

Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms 11–25