Compaq COBOL AAQ2G1FTK User Manual

Page 428

Advertising
background image

Using ACCEPT and DISPLAY Statements for Input/Output and Video Forms
11.3 Designing Video Forms with Screen Section ACCEPT and DISPLAY

Example 11–12 (Cont.) Designing a Video Form for a Daily Calendar

01 SCHEDULE-SCREEN BLANK SCREEN.

02 TITLE-BAR

FOREGROUND-COLOR 7 BACKGROUND-COLOR 4.
03 LINE 1 PIC X(80) FROM EMPTY-LINE.
03 LINE 1 COLUMN 30 VALUE "Schedule Appointment".

02 FIELDS-TEXT

FOREGROUND-COLOR 7 BACKGROUND-COLOR 1.
03 LINE 5 VALUE " Description of Appointment: ".
03 LINE PLUS 4 VALUE " Date of Appointment (DD/MM/YY): ".
03 COLUMN PLUS 5 VALUE "/

/".

03 LINE PLUS 2 VALUE " Time of Appointment (HH:MM mm): ".
03 COLUMN PLUS 5 VALUE ":".

02 FIELDS-INPUT

FOREGROUND-COLOR 7 BACKGROUND-COLOR 0 AUTO.
03 LINE 6

PIC X(160) TO APPT-NAME.

03 LINE 9

COLUMN 36 PIC XX USING APPT-DAY.

03 LINE 9

COLUMN 39 PIC XX USING APPT-MONTH.

03 LINE 9

COLUMN 42 PIC XX USING APPT-YEAR.

03 LINE 11 COLUMN 36 PIC XX USING APPT-HOUR.
03 LINE 11 COLUMN 39 PIC XX USING APPT-MINUTE.
03 LINE 11 COLUMN 42 PIC XX USING APPT-MERIDIEM.

02 HELP-TEXT

FOREGROUND-COLOR 6 BACKGROUND-COLOR 0.
03 LINE 16 COLUMN 18

VALUE " Use Cursor Keys to move within the fields. ".

03 LINE 17 COLUMN 18

VALUE " Press <Tab> to enter next field.

".

03 LINE 18 COLUMN 18

VALUE " Press <Return> when finished.

".

01 VERIFY-SUBSCREEN FOREGROUND-COLOR 7 BACKGROUND-COLOR 1.

02 LINE 16 COLUMN 1 ERASE EOS.
02 LINE 17 COLUMN 25 VALUE " Is this entry correct? (Y/N): ".
02 PIC X USING APPT-VERIFY AUTO.

PROCEDURE DIVISION.
P0.

DISPLAY MENU-SCREEN.

*

The cursor position is not within an item on the screen, so the

*

first item in the menu will be accepted first.

MOVE 0 TO CURSOR-LINE, CURSOR-COL.

*

The user moves the cursor with the arrow keys to the

*

desired menu item (to show, schedule, cancel, or print

*

appointments) and selects the item by pressing <Return>.

*

If the user wishes to exit without selecting an option,

*

the user can press the F10 function key.

ACCEPT MENU-SCREEN.

IF KEY1 EQUAL "0"

PERFORM OPTION_CHOSEN

ELSE IF KEY1 EQUAL "1" AND FKEY-10

DISPLAY "You pressed the F10 key; exiting..." LINE 22.

STOP RUN.

OPTION_CHOSEN.

(continued on next page)

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

Advertising