Progress
Language Reference


PUT SCREEN Statement

Interfaces
OS
SpeedScript
All
All
No

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

NOTE: This statement is only supported in character environments.

SYNTAX

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

ATTR-SPACE | NO-ATTR-SPACE

No effect; supported for backward compatibility only.

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).

SYNTAX
{    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

SEE ALSO

COLOR Phrase, DISPLAY Statement, HIDE Statement, PUT Statement


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