Previous Topic Next topic Print topic


The DISPLAY Statement

Format: for Format 1


DISPLAY WINDOW syntax diagram

Format: for Format 2


DISPLAY LINE syntax diagram

Format: for Format 3


DISPLAY BOX syntax diagram

Syntax Rules:

  1. line-num is a numeric literal or data item that specifies the line position on the terminal screen. It must be a non-negative integer.
  2. col-num is a numeric literal or data item that specifies the column position on the terminal screen. It must be a non-negative integer.
  3. length is a numeric literal or data item that specifies the window-width, line-width or box-width in character positions. It must be a non-negative integer.
  4. height is a numeric literal or data item that specifies the number of lines in the window, line or box. It must be a non-negative integer.
  5. title is a non-numeric literal or alphanumeric data item.
  6. save-area is an elementary data item described by a PICĀ X(10) clause.
  7. COLUMN and COL are equivalent.
  8. REVERSE and REVERSED and REVERSE-VIDEO are equivalent.
  9. The COLOR phrase is supported only when the preprocessor directive COLOR is used. This adds support for existing non-Micro Focus syntax.
  10. Exactly one of the SIZE or LINES phrases must be specified for a Format 2 DISPLAY statement.
  11. identifier-1, identifier-2, integer-1 and integer-2 must take a value in the range 0 through 7 as follows:
    0 black
    1 blue
    2 green
    3 cyan
    4 red
    5 magenta
    6 brown or yellow
    7 white
  12. identifier-3 and integer-3 must take a value which is obtained by adding together the appropriate values from the following:
    Color Foreground Background
    Black 1 32
    Blue 2 64
    Green 3 96
    Cyan 4 128
    Red 5 160
    Magenta 6 192
    Brown 7 224
    White 8 25
    Note:

    The foreground color values for use with the COLOR phrase are different from the standard Micro Focus color values for FOREGROUND-COLOR, BACKGROUND-COLOR and so on.

    In addition you can specify the following video attributes with the following values:

    Reverse video 1024
    Low intensity 2048
    High intensity 4096
    Underline 8192
    Blink 16384
  13. If a COLOR phrase is present at the same time as FOREGROUND-COLOR and/or BACKGROUND-COLOR, then the colors defined in the COLOR phrase are ignored, but any non-color attributes are actioned (where appropriate).

General Rules: for All Formats

  1. The LINE and COLUMN phrases must specify a line or column on the physical screen.
  2. On color systems, both the settings given in COLOR or FOREGROUND-COLOR and BACKGROUND-COLOR and other attribute settings (for example blink) are used. On monochrome systems, all color information supplied is ignored, and only other attribute settings used.
  3. Not all combinations of attributes are supported on all systems. For example, on a standard DOS PC, set to monochrome mode, REVERSE and UNDERLINE are mutually exclusive - only one of these attributes is actioned.

General Rules: for DISPLAY WINDOW statement Format 1 (DISPLAY WINDOW)

  1. The DISPLAY WINDOW statement creates and makes current a terminal window. The terminal window is a rectangular region of your screen. Any ACCEPT or DISPLAY statements (apart from another DISPLAY WINDOW/LINE/BOX or a Format 1, 2 or 3 ACCEPT or Format 1 DISPLAY as described in your Language Reference) affect only the current window. Furthermore, line and column numbers for all ACCEPT and DISPLAY statements (apart from another DISPLAY WINDOW/LINE/BOX or a Format 1, 2 or 3 ACCEPT or Format 1 DISPLAY as described in your Language Reference) are computed from the upper left-hand corner of the current window. That is, the current window defines a virtual terminal screen which occupies some area of your physical screen.
  2. The initial window is set to the entire screen.
  3. The only way to change the current window is with another DISPLAY WINDOW statement or with the CLOSE WINDOW statement.
  4. The LINE NUMBER phrase sets the top line of the window. Line number one refers to the top line of the screen. Line numbers are relative to the screen, and not to the current window.
  5. If the LINE NUMBER phrase is not specified, is specified as zero, or is off the physical screen, the top line of the screen is used.
  6. The COLUMN NUMBER phrase sets the left-most column of the window. Column number one refers to the left side of the screen. Column numbers are relative to the screen, and not to the current window.
  7. If the COLUMN NUMBER phrase is not specified, is specified as zero, or is off the physical screen, column number one is used.
  8. The SIZE phrase sets the number of columns the window contains. If this causes the window to extend past the right edge of the screen, the window's width extends off the screen.
  9. If the SIZE phrase is not specified or is specified as zero, the window extends to the right edge of the screen.
  10. The LINES phrase sets the number of rows the window contains. If this causes the window to extend past the bottom of the screen, the window extends off the screen.
  11. If the LINES phrase is not specified or is specified as zero, the window extends to the bottom edge of the screen.
  12. When the ERASE phrase is specified, the window is cleared immediately after it is created. Otherwise the window's contents are not changed. Clearing a window sets it to spaces.
  13. The BOXED phrase causes a box to be drawn around the new window. The box is drawn outside the window. Any portions of the box that lie off the screen are not drawn.
  14. The terminal's line drawing set is used to draw the box. If the terminal does not have a line drawing set, equivalent ASCII characters are used. If the POP-UP phrase is also specified, the box overlays any other boxes on the screen. If this phrase is not specified, the box drawn is attached to any other boxes it intersects. When a boxed non-popup window intersects a boxed popup window, if the popup window is created first, when it is closed the points where the two window boxes intersected is not redrawn. That is, intersection characters remain even though there is no longer an intersection.
  15. The ERASE phrase is implied by the BOXED phrase.
  16. The REVERSED phrase exchanges the window's foreground and background colors. This affects every ACCEPT and DISPLAY statement in the new window.
  17. The REVERSED phrase implies the ERASE phrase. This usually causes the entire window to be set to reverse video spaces when it is initially created.
  18. The SHADOW phrase causes the window to appear to float over the screen giving a three-dimensional effect.
  19. If the color value for either foreground or background is set to 0 in the COLOR field, then the corresponding color of the default system attribute is used.
  20. The TITLE phrase causes the title to be printed in the window's border. This has its effect only if the BOXED phrase is also specified.
  21. Titles can be placed in one of six positions in the border region: top left, top center, top right, bottom left, bottom center and bottom right. If TOP or BOTTOM is not specified, TOP is used. If LEFT, CENTERED or RIGHT is not specified, CENTERED is used.
  22. The NO SCROLL phrase is treated as documentary only; the Windows preprocessor displays a message confirming this.
  23. The NO WRAP phrase is treated as documentary only; the Windows preprocessor displays a message confirming this.
  24. The POP-UP AREA phrase causes your COBOL system to save system information prior to creating the new window. This information can be used by the CLOSE WINDOW statement to subsequently remove the new window and restore the underlying windows. This gives a popup window.
  25. The save-area data item is filled in with system information. This data item must not be subsequently modified in any way or results are undefined. It can be referenced in a CLOSE WINDOW statement to restore an earlier window to the screen and re-establish that window as the current window.

General Rules: for DISPLAY LINE statement Format 2 (DISPLAY LINE)

  1. The DISPLAY LINE statement enables you to draw vertical and horizontal lines in a machine- and terminal-independent manner. The lines are drawn using the best mode available on the display device. Used together with the DISPLAY BOX statement, this provides the ability to draw forms on your screen. The DISPLAY LINE statement does not affect the positioning of full screen ACCEPT and DISPLAY statements.
  2. Lines are drawn so that when they intersect other lines on the screen, the appropriate intersection character is used. This is done so that when the end of a line intersects another line, the appropriate corner or three-way intersection is used.
  3. If the SIZE phrase is specified, the line drawn is horizontal. The value of length gives the size of the line in screen columns. If the LINES phrase is used instead, the line drawn is a vertical line and height describes the number of screen rows to use.
  4. Lines never wrap around or cause scrolling. If the LINES or SIZE phrase would cause the line to leave the current window, the line is truncated at the edge of the window. If LINES or SIZE is zero, no line is drawn.
  5. The value of line-num gives the starting row of the line. The value of col-num gives the starting column. Lines are always drawn to the right or downward as appropriate. line-num and col-num must specify a position that is contained in the current window.
  6. If the LINE NUMBER or COLUMN NUMBER phrases specify a point outside the physical screen, that is, line-num = 0 or 24 (or your screen's maximum), or col-num = 0 or > 80, no line is drawn.
  7. The TITLE phrase has effect only when drawing horizontal lines. When specified, title-string is printed in part of the line.
  8. The title can be printed near the right side, near the left side or in the center of the line depending on the RIGHT, LEFT or CENTERED phrase specified. If none is specified, CENTERED is used.
  9. The REVERSE phrase exchanges the foreground and background color of the line.

General Rules: for DISPLAY BOX statement Format 3 (DISPLAY BOX)

  1. The DISPLAY BOX statement enables you to draw a box in a machine- and terminal-independent manner. The boxes are drawn using the best mode available on the display device. If the lines used in drawing a box intersect other lines already present on the screen, the appropriate intersection characters are used. The DISPLAY BOX statement does not affect the positioning of full screen ACCEPT and DISPLAY statements.
  2. The location of the box is specified by providing the location of the upper-left corner. The size of the box is specified by providing a height and a width.
  3. If the LINE NUMBER or COLUMN NUMBER phrases specify a point outside the physical screen no box is drawn.
  4. The SIZE phrase specifies the width of the box. The LINES phrase specifies its height. If the SIZE phrase is not specified, or zero, or such that the box would extend beyond the physical screen or the edge of the window, the box extends to the right edge of the current window. If the LINES phrase is not specified, or zero, or such that the box would extend beyond the physical screen, the box extends to the bottom of the current window.
  5. The REVERSE phrase operates in the same manner as it does for a DISPLAY WINDOW statement.
  6. The TITLE phrase operates in the same manner as it does for the DISPLAY WINDOW statement.
Previous Topic Next topic Print topic