Compaq COBOL AAQ2G1FTK User Manual
Page 426
Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms
11.3 Designing Video Forms with Screen Section ACCEPT and DISPLAY
screen (starting in the 60th column of the first line). Elsewhere, you could
display the legend box, using the same screen description entry, at a different
position on the screen, by choosing different LINE and COLUMN options with
the DISPLAY statement.
•
The default value for an update screen item is the current value of the FROM
or USING data item. The default value for an input screen item is spaces or
zero, depending on the data type of the screen item.
If the operator terminates the ACCEPT before entering a value for each field,
the default value remains in the untouched screen items.
•
To catch any function keys that the operator presses, use the CRT STATUS
option. All control sequences are captured and processed by Compaq COBOL
and not returned to the application.
Refer to Section 11.2, and also the Compaq COBOL Reference Manual Data
Division chapter’s section on Screen Description and clauses, for details on these
features.
In Example 11–12, a video form is designed for a daily calendar. With it you
can display appointments, schedule new appointments, cancel appointments, and
print appointments.
Example 11–12 Designing a Video Form for a Daily Calendar
IDENTIFICATION DIVISION.
PROGRAM-ID. MENU.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
*
The SPECIAL-NAMES paragraph that follows provides for the
*
capturing of the F10 function key and for positioning of the
*
cursor.
SPECIAL-NAMES.
SYMBOLIC CHARACTERS
FKEY-10-VAL
ARE 11
CURSOR IS CURSOR-POSITION
CRT STATUS IS CRT-STATUS.
DATA DIVISION.
WORKING-STORAGE SECTION.
*
CURSOR-LINE specifies the line and CURSOR-COL specifies the
*
column of the cursor position.
01
CURSOR-POSITION.
02
CURSOR-LINE
PIC 99.
02
CURSOR-COL
PIC 99.
(continued on next page)
11–36 Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms