PreviousNextIndex

COLOR phrase

Specifies a video attribute or color. In Progress Version 7 and later, the COLOR phrase is superseded by the FGCOLOR and BGCOLOR options in graphical user interfaces and by the PFCOLOR and DCOLOR options in character interfaces. The COLOR phrase is supported only for backward compatibility.

Note: Does not apply to SpeedScript programming.
Syntax

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

NORMAL, INPUT, MESSAGES
protermcap-attribute
dos-hex-attribute
[ BLINK- ] [ BRIGHT- ] [ fgnd-color ] [ bgnd-color ]
[ BLINK- ] [ RVV- ] [ UNDERLINE- ] [ BRIGHT- ] [ fgnd-color ]
VALUE ( expression )
Example

The following procedure displays a random number of asterisks, in a random color, column, and row in 10 different occurrences. The COLOR statement displays the asterisks in one of the three colors stored in the elements of the hilite array. The COLOR phrase in this example is VALUE ( hilite[ RANDOM( 1,3 ) ]. The DISPLAY statement uses the color determined in the COLOR statement to display a random number of asterisks.

r-colphr.p
DEFINE VARIABLE hilite AS CHARACTER NO-UNDO EXTENT 3. 
DEFINE VARIABLE loop   AS INTEGER   NO-UNDO. 
hilite[1] = "NORMAL". 
hilite[2] = "INPUT".  /* attribute to highlight */ 
hilite[3] = "MESSAGES". 
REPEAT WHILE loop <= 10: 
  FORM bar AS CHARACTER WITH ROW(RANDOM(3,17)) 
    COLUMN(RANDOM(5,50)) NO-BOX NO-LABELS 
    FRAME bursts. 
  COLOR DISPLAY VALUE(hilite[RANDOM(1,3)]) bar 
    WITH FRAME bursts. 
  DISPLAY FILL("*",RANDOM(1,8)) @ bar WITH FRAME bursts. 
  PAUSE 1 NO-MESSAGE. 
  HIDE FRAME bursts NO-PAUSE. 
  loop = loop + 1. 
END. 

Notes
See also

COLOR statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex