Previous Next

COLOR statement
Indicates the video attribute or color for normal display or for data entry.
Note:
Syntax 
 
COLOR [ DISPLAY ] color-phrase [ PROMPT color-phrase ]
       { field ... } { [ frame-phrase ] }
 
COLOR PROMPT color-phrase 
      { field ... } { [ frame-phrase ] }
DISPLAY
Indicates that you want to use a specific color when the system displays a field.
PROMPT
Indicates that you want to use a specific color when the system prompts a user for input by an INSERT, PROMPT-FOR, SET, or UPDATE statement.
color-phrase
Specifies a video attribute or color. Following is the syntax for color-phrase:
 
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 on color-phrase, see the COLOR phrase reference entry. ABL ignores the color-phrase entry for overlay frames on spacetaking terminals.
field
The name of the field or fields for which you want to override the default colors.
frame-phrase
Specifies the overall layout and processing properties of a frame. For more information see the Frame phrase reference entry.
Example 
This procedure highlights the item number and on‑hand fields for items with an on‑hand value less than 50. The variable hilite holds the video attribute (color) for highlighting. In this case, the system uses whatever attribute is used for the message area (such as reverse video, bright, or a color).
 
DEFINE VARIABLE hilite AS CHARACTER NO-UNDO INITIAL "messages".
 
/* Use standard messages attribute to highlight OnHand less than 50 */
FOR EACH Item NO-LOCK:
  DISPLAY Item.ItemNum Item.ItemName Item.OnHand WITH ATTR-SPACE.
  IF Item.OnHand < 50 THEN
    COLOR DISPLAY VALUE(hilite) Item.ItemNum Item.OnHand.
END.
Notes 
*
*
*
 
COLOR DISPLAY NORMAL PROMPT INPUT field 
Or:
 
COLOR DISPLAY NORMAL PROMPT INPUT field WITH FRAME frame 
*
If you run precompiled procedures on a spacetaking terminal, you must specify the frame field where a color or other video attribute is applied as, or is by default, ATTR-SPACE.
*
If you write a procedure (for a non‑spacetaking terminal) that uses color and you run it on a spacetaking terminal, the AVM does not display the colors. To display the colors, you must use the ATTR-SPACE option.
*
Certain terminals, such as the WYSE 75, are non‑spacetaking for some attributes and spacetaking for others.
*
See also 
COLOR phrase, DISPLAY statement, Frame phrase

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