Compaq COBOL AAQ2G1FTK User Manual

Page 417

Advertising
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 (Cont.) Using the CONTROL KEY IN Phrase

DISPLAY "Not an allowable control key -"

"press the Return key to continue"

LINE 10 COLUMN 5
WITH BELL ERASE LINE.

ACCEPT CONTROL-KEY.
GO TO P1.

P2.

DISPLAY "Press the Return key to end this job"

LINE 11 COLUMN 5 ERASE LINE.

ACCEPT CONTROL KEY IN CONTROL-KEY LINE 12 COLUMN 5 ERASE LINE.
IF NOT CR GO TO P0

ELSE

DISPLAY "END OF JOB" LINE 13 COLUMN 35

BOLD BLINKING REVERSED BELL
ERASE SCREEN.

P3.
* DISPLAY ESC ">" WITH NO puts you out of alternate keypad mode
*

DISPLAY ESC ">" WITH NO.
STOP RUN.

Figure 11–12 shows a sample run of the program in Example 11–10 using the
right arrow terminal key.

To expand upon Example 11–10, you can, for example, accept data in addition
to specifying the CONTROL KEY phrase. This enables you to accept data and
determine what to do next based on the data. You can use the CONTROL KEY
phrase to move the cursor around on the screen or take a specific course of
action.

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

Advertising