Previous Page | Next Page

SAS Component Language Dictionary

FLDCOLOR



Changes the color and display attributes of a field, text entry widget, or text label widget to those stored in an attribute string
Category: Widget or Field

Syntax
Details
Examples
Example 1: Changing the Color and Attributes of Character Positions
Example 2: Changing the Color of a Field
Example 3: Using a SASCOLOR Window Element to Change the Color of a Field
See Also

Syntax

rc=FLDCOLOR(wcol-name,color,attribute,start,length);

rc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

wcol-name

specifies the field, text entry widget, or text label widget to be changed.

Type: Character

color

specifies either a color name, or '' to retain the current color. Colors are BLACK, BLUE, BROWN, CYAN, GRAY, GREEN, MAGENTA, ORANGE, PINK, RED, WHITE, and YELLOW. SASCOLOR window elements can also be used for color.

Type: Character

attribute

specifies either a display attribute, or '' to retain the current attribute. Attributes are NONE, BLINKING, HIGHLIGHT, HIREV, REVERSE, and UNDERLINE. If you specify a SASCOLOR window element for color, then attribute is ignored because the SASCOLOR window element contains a display attribute. However, you must specify a placeholder ('') for attribute when you specify arguments after it.

Type: Character

start

specifies the position in the field at which to begin applying the specified color and display attributes.

Type: Numeric

length

specifies the number of positions to which the specified color and display attributes are to be applied.

Type: Numeric


Details

FRAME entry widgets can also use the _setColor method.

To change the color for the entire field or FRAME entry widget, you can use the FIELD function.


Examples


Example 1: Changing the Color and Attributes of Character Positions

Change the color of the third through seventh character positions in field ABC to red, and change the display attribute of those positions to high intensity:

rc=fldcolor('abc','red','highlight',3,5);


Example 2: Changing the Color of a Field

Change the color of a field, but leave the attributes the same:

rc=fldcolor('abc','red','',3,7);


Example 3: Using a SASCOLOR Window Element to Change the Color of a Field

Change the color of a field, using a SASCOLOR window element:

rc=fldcolor('abc','foreground','',3,7);


See Also

FIELD

FLDATTR

STRATTR

Previous Page | Next Page | Top of Page