Progress
Language Reference


COLOR Phrase

Interfaces
OS
SpeedScript
All
All
No

Specifies a video attribute or color. In Progress Version 7 and later, the COLOR phrase is superceded 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.

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

The three standard colors Progress uses for screen displays. Progress uses NORMAL to display fields, INPUT to display input fields, and MESSAGES to display items in the message area.

Following are the NORMAL defaults:

protermcap-attribute

You use the protermcap-attribute option only if you are using UNIX. This is the name assigned to the attribute in the protermcap file (for example, RED, BLINK, etc.). See the Progress Client Deployment Guide for a description of the protermcap file.

dos-hex-attribute

A hex string with a value of 00 through FF.

[ BLINK- ] [ BRIGHT- ] [ fgnd-color ] [ bgnd-color ]

Names specific colors you want to use for the screen foreground and background. You use this option only if you are using Windows, and usually only if you use a color monitor. Table 12 lists the colors you can use for fgnd-color and bgnd-color.

Table 12: Windows Colors
Color
Abbreviation
Black
Bla, Blk
Blue
Blu
Green
Gre, Grn
Cyan
C
Red
Red
Magenta
Ma
Brown
Bro, Brn
Gray
Gra, Gry
Dark-Gray
D-Gra
Light-Blue
Lt-Blu
Light-Green
Lt-Gre
Light-Cyan
Lt-C
Light-Red
Lt-Red
Light-Magenta
Lt-Ma
Light-Brown
Lt-Bro
Yellow
Y
White
W

If fgnd-color is omitted, then the system uses the foreground corresponding to NORMAL. If bgnd-color is omitted, then the system uses the background corresponding to NORMAL. If NORMAL, INPUT, or MESSAGES is specified for fgnd-color or bgnd-color, then the system uses the foreground or background color of the specified standard color.

[ BLINK- ] [ RVV- ] [ UNDERLINE- ] [ BRIGHT- ] [ fgnd-color ]

Names specific attributes you want to use for the screen display. Use this option only if you are using Windows, and usually only if you use a monochrome monitor. Normally, you would never specify fgnd-color.

VALUE ( expression )

An expression with a value that results in one of the options in the COLOR phrase.

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 EXTENT 3.
DEFINE VARIABLE loop AS INTEGER.
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


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