ACUCOBOL-GT allows you to add color, without reprogramming, to programs that were originally written for black-and-white terminals. You accomplish this by assigning color values to the runtime configuration variable COLOR-MAP . The COLOR-MAP keyword is followed by one of the following single attributes:
High, Low, Reverse, Blink, Underline, Default, or Exit;
or by one of the following hyphenated combinations of attributes:
High-Reverse | Low-Reverse |
High-Blink | Low-Blink |
High-Reverse-Blink | Low-Reverse-Blink |
High-Underline | Low-Underline |
High-Reverse-Underline | Low-Reverse-Underline |
Reverse-Blink | Reverse-Underline |
The single attribute, or attribute combination, is then followed by an equals sign and one of the following color names:
Black, Blue, Green, Cyan, Red, Magenta, Brown, White
The named color becomes the foreground color that is displayed whenever the corresponding attribute is used in a DISPLAY statement. For example, if you want fields that are displayed as low-intensity to appear green, use the following configuration file entry:
COLOR-MAP Low=Green
You can also assign a background color value. It follows the foreground color and is separated from it by a comma. For example, to assign white characters on a blue background for high-intensity fields, you would use the following:
COLOR-MAP High=White,Blue
You may specify more than one attribute in a single COLOR-MAP line. Simply separate the attributes from each other by spaces. For example:
COLOR-MAP High=Green Low=Red Reverse=Blue
The following points should be noted:
For example, a DISPLAY statement specifying both REVERSE and HIGH will use the color associated with REVERSE.
Also, any one of these settings is used for all applicable cases, except where specifically overridden by another setting. For example:
COLOR-MAP REVERSE=Red LOW-REVERSE=Blue
will use red for all statements that specify REVERSE except for statements that explicitly specify REVERSE,LOW.
In all other cases, the configuration variable must exactly match the COBOL statement. For example, a configuration file attribute HIGH-REVERSE would not apply to a program statement that included HIGH,REVERSE,UNDERLINE.
Note that compiler options -Vl and -Vh cause LOW and HIGH respectively to be implied for program statements; create your COLOR-MAP as though LOW or HIGH were explicitly coded in the program.
SET ENVIRONMENT "COLOR-MAP" TO "OFF"
For these reasons, we recommend that you avoid using a high-intensity background color if you are using the XENIX console. As an alternative, you may create a shell script to run ACUCOBOL-GT. This script could set a low-intensity background color, run ACUCOBOL-GT, and then reset the desired high-intensity background color.