This field-level keyword specifies the color of a field on a color display (3179, 3197 Models C1 and C2, 3477 Model FC, 3486, 3487 Model HC, 3488 4 or 5292 Color Display Stations only). This keyword is ignored if it is selected for a field displayed on monochrome display stations. You can specify one parameter value for the COLOR keyword, but you can specify more than one COLOR keyword on each field.
The format of the keyword is:
COLOR(GRN | WHT | RED | TRQ | YLW | PNK | BLU)
The valid parameter values are:
Because green is the default color of the fields on color display stations, you need to specify COLOR(GRN) only to keep the color of a field green. Specifying DSPATR(HI), DSPATR(CS), or DSPATR(BL) for a field changes the color of the field unless you also specify COLOR(GRN).
Option indicators are valid for this keyword.
When you specify the COLOR keyword more than once for a field, you must specify option indicators with each COLOR keyword. If more than one COLOR keyword is in effect for an output operation, the OS/400 program uses the first COLOR keyword that is specified in the DDS (see example 1, below). You cannot specify the same color more than once for a field.
The number of COLOR keywords you can specify in one display file is limited by the maximum size of an internal storage area of the system called the screen attribute array. The maximum size of the screen attribute array is 32 763 bytes for the entire display file. Each COLOR keyword you specify in the file uses up a significant amount of storage within this array.
If you use many COLOR keywords in a file, particularly with conditioning, you should consider the amount of internal storage these keywords will require. If the 32 763-byte limit is exceeded, message CPF0673 (Too many COLOR or DSPATR keywords specified in file) is issued during file creation. To determine the amount of storage required for a particular COLOR keyword, use the following algorithm:
(# of conditions for the keyword) x 2 + 2 + 29 = # of bytes required in the screen attribute array for the keyword
For example, suppose a file contains 8 fields, each field contains 9 COLOR keywords, and each COLOR keyword is optioned using 3 conditions. Using the above algorithm, each COLOR keyword requires 520 bytes in the screen attribute array:
3 x 2 + 2 + 29 = 520 bytes
Since there are 9 COLOR keywords per field and 8 fields in the file, the total storage required in the screen attribute array is 37 440 bytes (520 x 9 keywords x 8 fields). Since 37 440 is greater than 32 763, message CPF0673 is issued at file creation time.
Using the COLOR keyword with the DSPATR keyword:
In some combinations of COLOR and DSPATR, both keywords have effect. Those combinations are:
For example, if COLOR(YLW) and DSPATR(RI) are both in effect, the field appears as black characters on a yellow background.
In some combinations of the COLOR and DSPATR keywords, some of the
parameter values are ignored. Those combinations are shown in the
following table.
COLOR |
DSPATR |
Effect |
---|---|---|
Any Any Any |
ND (nondisplay) HI (high intensity) CS (column separators) |
All colors are ignored HI is ignored CS is ignored1 |
GRN WHT TRQ YLW PNK BLU |
BL BL BL BL BL BL |
BL is ignored2 BL is ignored2 BL is ignored2 BL is ignored2 BL is ignored2 BL is ignored2 |
RED |
RI and BL and UL |
UL is ignored3 |
YLW BLU WHT |
RI and UL RI and UL RI and UL |
RI is ignored RI is ignored RI is ignored |
Notes:
|
For example, if COLOR(YLW) and DSPATR(HI) are both selected for an output operation, the field is yellow but not high intensity.
Using the DSPATR keyword on color displays:
When you specify the DSPATR keyword without the COLOR keyword, fields are
displayed on color displays with the colors in the following table but without
the specified display attributes.
Table 4. DSPATR Keyword on Color Displays
DSPATR(CS) Display Attribute Selected | DSPATR(HI) Display Attribute Selected | DSPATR(BL) Display Attribute Selected | Color Produced on the Color Display Station |
---|---|---|---|
|
|
| Green (normal) |
X |
|
| Turquoise1 |
| X |
| White |
|
| X | Red, no blinking |
| X | X | Red, with blinking |
X | X |
| Yellow1 |
X |
| X | Pink |
X | X | X | Blue |
|
For example, if DSPATR(HI) is selected for a field and the COLOR keyword is not specified, the field is white but not highlighted on a color display.
The COLOR keyword is ignored if it is selected for a monochrome display.
Example 1:
The following example shows the effects of specifying COLOR and DSPATR for a field.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RECORD (1) 00020A 1 2'Column Heading' 00030A DSPATR(HI) 00040A (2) FIELD1 5 3 2 00050A (3) FIELD2 5 I 5 2COLOR(YLW) 00060A (4) FIELD3 5 7 2DSPATR(BL) 00070A (5) FIELD4 5 I 9 2 00080A 42 COLOR(YLW) 00090A 43 COLOR(TRQ) 00100A 44 COLOR(BLU) A
On monochrome displays, FIELD4 is green. On all displays, FIELD4 is underlined.
Example 2:
The following example shows one way of specifying a field for use as an input-capable field on both color and monochrome displays.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RECORD 00020A(2)(1) FIELDA 5 B 2 2COLOR(TRQ) 00030A 44 ERRMSG('Record not found' 44) A
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.