[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP COBOL
|
Previous | Contents | Index |
Because the ACCEPT statements in Example 11-11 contain EDITING
phrases, a person using the form in Figure 11-13 can use any of the
keys listed in Table 11-3 for field editing purposes to make
corrections or modifications.
11.3 Designing Video Forms with Screen Section ACCEPT and DISPLAY (Alpha, I64)
The Screen Section feature provides an efficient alternative to the ACCEPT and DISPLAY extensions for designing video forms. Screen Section, which is based on the X/Open CAE Specification for COBOL, is also a Hewlett-Packard extension to the ANSI Standard. It enables you to design video forms in a single section of your HP COBOL program. Then, in the Procedure Division, you can accept or display an entire screen of data with a single ACCEPT or DISPLAY statement, instead of multiple statements.
You can design your form as follows:
SPECIAL-NAMES. CURSOR IS CURSOR-POSITION CRT STATUS IS CRT-STATUS. |
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". |
DISPLAY MENU-SCREEN. . . . ACCEPT MENU-SCREEN. |
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 HP COBOL Reference Manual):
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 HP COBOL Reference Manual.)
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. |
BLANK SCREEN | 1, 2, 3 | Clears the screen before displaying the screen item. |
BLANK WHEN ZERO[ES] | 3 | Replaces zeros with spaces when a screen item's value is zero. |
BLINK | 2, 3 | Causes the displayed item to blink. |
COLUMN NUMBER | 2, 3 | Specifies the horizontal position of an item on the screen. |
ERASE EOL | 2, 3 | Clears the line from the cursor position to the end. |
ERASE EOS | 2, 3 | Clears the screen from the cursor position to the end. |
FOREGROUND-COLOR | 1, 2, 3 | Specifies by number (in range 0--7) the screen item's foreground color. See the color list that follows. |
FULL | 1, 3 | Specifies that a screen item must either be left completely empty or be entirely filled with data. |
HIGHLIGHT | 2, 3 | Specifies that the field is to appear on the screen with the highest intensity. |
JUSTIFIED RIGHT | 3 | Specifies nonstandard data positioning. This can cause truncation of the leftmost characters if the sending item is too large. Otherwise, this aligns the data at the rightmost character position. |
LINE NUMBER | 2, 3 | Specifies the vertical position of an item on the screen. |
LOWLIGHT | 2, 3 | Specifies that the field is to appear on the screen with the lowest intensity. If only two levels of intensity are available, LOWLIGHT is the same as normal. |
REQUIRED | 1, 3 | Specifies that at least one character must be entered in the input or update field. |
REVERSE-VIDEO | 2, 3 | Specifies that the foreground and background colors be exchanged. |
SECURE | 1, 3 | Specifies that no characters are displayed when the input field is entered. |
SIGN LEADING [SEPARATE] | 1, 3 | Specifies the existence of a sign character as the leading character in the field. The SEPARATE option is always in effect if the screen item has an 'S' in the PICTURE clause. Therefore, for a screen item, the sign character never shares its position with a digit. |
SIGN TRAILING [SEPARATE] | 1, 3 | Specifies the existence of a sign character as the trailing character in the field. The SEPARATE option is always in effect if the screen item has an 'S' in the PICTURE clause. Therefore, for a screen item, the sign character never shares its position with a digit. |
UNDERLINE | 2, 3 | Specifies that each character of the field is to be underlined when displayed. |
USAGE DISPLAY | 1, 3 | Specifies the internal format of a data item as DISPLAY (the default). |
When you specify the foreground and background colors for a screen item, you use numbers in the range 0--7, which represent specific colors as described in Table 11-5. Note that these colors are supported only on terminals that support ANSI Standard color sequences.1
Color | Color Value | Color | Color Value |
---|---|---|---|
Black | 0 | Red | 4 |
Blue | 1 | Magenta | 5 |
Green | 2 | Yellow/Brown | 6 |
Cyan | 3 | White | 7 |
1 This does not include the VT100, VT200, VT300, VT400, and VT500 series terminals. On workstations that emulate these terminal types, this restriction may not apply. |
Previous | Next | Contents | Index |