beautypg.com

Compaq COBOL AAQ2G1FTK User Manual

Page 422

background image

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

For example:

SCREEN SECTION.

01 MENU-SCREEN BLANK SCREEN FOREGROUND-COLOR 7 BACKGROUND-COLOR 1.

02 MENU-SCREEN-2.

03 TITLE-BAR

FOREGROUND-COLOR 7 BACKGROUND-COLOR 4.
04 LINE 1 PIC X(80) FROM EMPTY-LINE.
04 LINE 1 COLUMN 32 VALUE "Daily Calendar".

See Section 11.3.1 for a description of the options available in the Screen
Section.

3.

Then you use the ACCEPT and DISPLAY statements in the Procedure
Division with the screen description entries described in the Screen Section to
accept or display each entire screen or part of the screen. During a DISPLAY,
all output and update screen items are displayed. During an ACCEPT, all
input and update screen items are accepted.

For example:

DISPLAY MENU-SCREEN.
.
.
.
ACCEPT MENU-SCREEN.

11.3.1 Using Screen Section Options

You design your screens with screen description entries in the Screen Section
of the Data Division of your program. Three formats are available for a screen
description entry (and are completely defined in the Data Division chapter of the
Compaq COBOL Reference Manual):

Format 1 — A group screen item

Format 2 — An elementary output screen item with a literal value; it includes
the VALUE clause

Format 3 — An elementary output, input, or update screen item; it includes
the PICTURE clause

Table 11–4 shows the optional clauses you can use in a screen description entry
to specify character attributes, the formats to which they apply, and a summary
of their functions. (They are completely described in the Data Division chapter of
the Compaq COBOL Reference Manual.)

Table 11–4 Character Attribute Clauses for Screen Description Formats

Clause

Formats

Function

AUTO

1,3

Moves the cursor to the next field when the last
character of a field is entered.

BACKGROUND-
COLOR

1, 2, 3

Specifies by number (in the range 0–7) the screen
item’s background color (see the color list that follows).

BELL

2, 3

Sounds the audio tone on the workstation or terminal.

BLANK LINE

2, 3

Clears the line before displaying the screen item.

(continued on next page)

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