The DISPLAY Statement

General Format

The following format of the DISPLAY statement is supported:


Syntax for the DISPLAY statement

General Rules

  1. The DISPLAY operation treats a group item as an elementary item, if you set the MS Compiler directive when you submit your source code to your COBOL system: it displays the item itself and not its subordinate elementary items.
  2. If the screen position at which the first operand is to appear is not specified, the default is the current cursor position, if you set the MS Compiler directive when you submit your source code to your COBOL system.
  3. Rules 1 and 2 above also apply to Format 3 of the DISPLAY statement as described in the topic The DISPLAY Statement.
  4. If ERASE is specified, the screen is cleared from the current cursor position onwards.

The following two rules are additional rules which apply to Format 3 of the DISPLAY statements described in the topic The DISPLAY Statement.

  1. The WITH phrase options and their synonyms are:

    BACKGROUND-COLOR BELL/BEEP BLANK BLINK FOREGROUND-COLOR HIGHLIGHT REVERSE-VIDEO SIZE UNDERLINE

  2. FOREGROUND-COLOR and BACKGROUND-COLOR. Integer-1 in these clauses specifies the foreground color and background color of the screen item respectively, and can be defined by a value from 0 to 15, as follows:
    0 black 8 grey
    1 blue 9 light blue
    2 green 10 light green
    3 cyan 11 light cyan
    4 red 12 light red
    5 magenta 13 light magenta
    6 brown 14 yellow
    7 white 15 high intensity white

    On a color screen, if the FOREGROUND-COLOR option specifies an integer whose value is from 8 to 15, this is equivalent to specifying an integer from 0 to 7 and specifying the HIGHLIGHT option. On a monochrome screen, this is equivalent to simply specifying the HIGHLIGHT option.

    On a color screen, if the BACKGROUND-COLOR option specifies an integer whose value is from 8 to 15, this is equivalent to specifying an integer from 0 to 7 and specifying the BLINK option. On a monochrome screen, this is equivalent to simply specifying the BLINK option.