Previous Next

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:
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, the AVM does not display that data with color. If you are displaying data in a column other than column 1, the AVM 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, the AVM 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, the AVM 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.
 
DEFINE VARIABLE paid-owed AS DECIMAL   NO-UNDO.
DEFINE VARIABLE bal-label AS CHARACTER NO-UNDO FORMAT "x(20)".
 
FOR EACH Customer NO-LOCK:
  paid-owed = Customer.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 Customer.CustNum Customer.Name paid-owed LABEL " " WITH 1 DOWN.
  IF Customer.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

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.