Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-38
DISPLAY Statement
DEPENDING ON identifier
selects either zero or one screen-identifier from the list of screen fields.
The statement whose position in the screen-identifier list is the same as the
value in identifier is selected. If the value in identifier is less than 1 or
greater than the number of screen identifiers, no screen-identifier is
selected.
SHADOWED
selects from the screen-identifier list only those fields that have
SHADOWED items in which the SELECT bit is set. Fields in the
screen-identifier list that do not have SHADOWED items are not selected.
The DEPENDING ON clause for the DISPLAY statement is analogous to the
DEPENDING ON clause for the PERFORM ONE statement. The following example
illustrates this.
WORKING-STORAGE SECTION.
:
77 ws-screen-status PIC 9(4) COMP VALUE 1.
01 ws-fld1 PIC x(10).
01 ws-fld2 PIC x(10).
01 ws-fld3 PIC x(10).
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-fld1 at 4, 20
PIC X(10)
from fld1.
05 screen-fld2 at 5, 40
PIC X(10)
from fld2.
05 screen-fld3 at 6, 60
PIC X(10)
from fld3.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
DISPLAY SCREEN-FLD1,
SCREEN-FLD2,
SCREEN-FLD3,
DEPENDING ON WS-SCREEN-STATUS.
If WS-SCREEN-STATUS equals 1, SCREEN-FLD1 is displayed. If WS-SCREEN-
STATUS equals 2, SCREEN-FLD2 is displayed, and so on. It is not considered
erroneous if WS-SCREEN-STATUS < 1 or WS-SCREEN-STATUS > 3. Control just
Note. If neither the DEPENDING ON modifier nor the SHADOWED modifier is specified, all
fields in the list are selected.