Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## PUT SCREEN statement

> ##
> (Character only)

> Displays a character expression at a specified location on a screen, overlaying any other data that might be displayed at that location.

> This statement is supported only for backward compatibility.

> Note: Does not apply to SpeedScript programming.

> #### Syntax

>     PUT SCREEN
>       [ ATTR-SPACE | NO-ATTR-SPACE ]
>       [ COLOR color-phrase ]
>       [ COLUMN expression ]
>       [ ROW expression ]
>       expression

> `ATTR-SPACE | NO-ATTR-SPACE`

> Has no effect; supported only for backward compatibility.

> `COLOR `color-phrase``

> The video attributes you want to use to display an expression. When you display data in the first column of a spacetaking terminal, Progress does not display that data with color. If you are displaying data in a column other than column 1, Progress displays the color attribute in the column prior to the current column (current column minus 1).

>     {    NORMAL
>       |  INPUT
>       |  MESSAGES
>       |  protermcap-attribute
>       |  dos-hex-attribute
>       |  { [ BLINK-]
>            [ BRIGHT- ]
>            [ fgnd-color ]
>            [ bgnd-color ]
>          }
>       |  { [ BLINK- ]
>            [ RVV- ]
>            [ UNDERLINE- ]
>            [ BRIGHT- ]
>            [ fgnd-color ]
>          }
>       |  VALUE ( expression )
>     }

> For more information, see the COLOR phrase reference entry.

> `COLUMN `expression``

> The column in which you want to display an expression. In the COLUMN option, `expression` is a constant, field name, variable name, or expression whose value is an integer that indicates the column in which you want to display an expression. If you do not use the COLUMN option, PUT SCREEN displays the expression at column 1. If you specify a COLUMN that is outside the screen area, Progress disregards the PUT SCREEN statement.

> `ROW `expression``

> The row in which you want to display an expression. In the ROW option, `expression` is a constant, field name, variable name, or expression whose value is an integer that indicates the row you want to display an expression. If you do not use the ROW option, PUT SCREEN displays the expression at row 1. If you specify a ROW that is outside the screen area, Progress disregards the PUT SCREEN statement.

> ``expression``

> A constant, field name, variable name, or expression that results in a character string. The character string can contain control characters and can be as long as you want.

> Example

> The `r-putscr.p` procedure determines whether a customer’s current balance is above or below 0. If it is above 0, they have a credit; if it is below 0, they owe money. The label of the balance column is changed based on whether they have a credit or owe money.

> r-putscr.p
>     DEFINE VARIABLE paid-owed AS DECIMAL.
>     DEFINE VARIABLE bal-label AS CHARACTER FORMAT "x(20)".

>     FOR EACH customer:
>         paid-owed = balance.
>         IF  paid-owed < 0  /* Customer has a credit */
>         THEN DO:
>             paid-owed = - paid-owed.
>             bal-label = "Customer Credit".
>         END.
>         ELSE bal-label = "Unpaid balance".
>         DISPLAY cust-num name
>         paid-owed LABEL " " WITH 1 DOWN.
>         IF balance < 0
>         THEN PUT SCREEN COLOR MESSAGES ROW 2 COLUMN 34 bal-label.
>         ELSE PUT SCREEN ROW 2 COLUMN 34 bal-label.
>     END.

> If the customer has a credit (balance < 0) the first PUT SCREEN statement displays the value of bal-label (which is Customer Credit) in the same color as you see system MESSAGES (usually reverse video).

> If the customer owes money (balance > 0) the second PUT SCREEN statement displays the value of bal-label (which is Current Balance) in normal display mode.

> #### Notes

> - Values displayed by PUT SCREEN are not the same as values that belong to frames. Thus those expressions can be overwritten by other displays or hides. Ensure that values displayed by PUT SCREEN do not overwrite frame fields that are used later for data entry.

> - If you use the PUT SCREEN statement in a procedure that runs in batch or background mode, Progress disregards the PUT SCREEN statement.

> - The HIDE ALL statement clears the entire screen, including any data displayed by a PUT SCREEN statement.

> - The Wyse 75 terminal is spacetaking for some COLOR attributes and non-spacetaking for others. This difference interferes with resetting COLOR MESSAGE (non-spacetaking) back to COLOR NORMAL in a PUT SCREEN statement. If you use WHITE instead of NORMAL whenever you reset color attributes back to normal video attributes, the Wyse 75 behaves like other terminals.

> - If you use the PUT SCREEN statement to display data in the message area, the HIDE MESSAGES statement does not necessarily clear that data.

> #### See also

> COLOR phrase, DISPLAY statement, HIDE statement, PUT statement

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095