COLOR


The COLOR statement changes the color of a displayed field’s foreground and/or background based on the contents of the predefined fields COLOR FOREGROUND and COLOR BACKGROUND. All fields displayed on the screen can be affected by using the global COLOR statement, as shown below, or a specific field’s colors can be changed by identifying the field.

          SET      --- COLOR FOREGROUND           =      RED
    ••••• COLOR    ••• •••••••••••••••••••••• ••• (AT APPEARANCE # •••)
    (1)            (2) (3)                    (4)                  (5)

(1) T/F execution conditions

(2) Application ID

(3) Field name or predefined field

(4) Occurrence (constant/index)

(5) Appearance (constant/index)

Using the Statement

The appearance number can be used if the same field appears more than once on an image. If the application ID, field name, occurrence number, and appearance number are not specified (left blank), the COLOR statement affects all of the items painted on the associated image using either default colors or the colors specified in the predefined fields COLOR FOREGROUND and COLOR BACKGROUND.

COLOR is one of the characteristic-type statements. Refer to the common attributes of all the statements in this category in the Characteristic-Type Statements section of this manual.

The operation of a COLOR statement affects only the next generation of an image. In other words, the item characteristics are reset each time an image is produced,

Restrictions

Note that, because the COLOR statement operates on items rather than fields, this statement is meaningful only in event points that are associated with an image.

Statement Ignored

The system ignores any COLOR statements specified in non-image-related event points.

Related Statements

BLANK, BLINK, BOLD, BRIGHT, DIM, DISPLAY, FONT, INVERSE, NO BOLD, NO ULINE, NORMAL, PICTURE, ULINE

Example

The COLOR statement is used to cause the current foreground and/or background colors of a field to change on the image. In this example, the customer’s credit status displays in red if the status is BAD. If the status is not BAD, it is displayed in blue.

          IF       TAR CUSTOMER CREDIT STATUS     EQ     BAD
    T     SET      --- COLOR FOREGROUND           =      RED
    F     SET      --- COLOR FOREGROUND           =      BLUE
          COLOR    TAR CUSTOMER CREDIT STATUS     (AT APPEARANCE #    )
          DISPLAY  TAR CUSTOMER CREDIT STATUS     (AT APPEARANCE #    )