Previous Page | Next Page

SAS Component Language Dictionary

STRATTR



Defines a string for color and display attributes
Category: Widget or Field

Syntax
Details
Example
See Also

Syntax

cval=STRATTR(color,attribute,start,length);

cval

is a string that contains the specified color and display attributes.

Type: Character

color

is 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

is 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

is the starting character position to store in the attribute string.

Type: Numeric

length

is the number of character positions to store in the attribute string.

Type: Numeric


Details

STRATTR defines a string that you can use with FLDATTR to change the color and display attributes of fields or portions of fields in an application window. STRATTR can be called multiple times to create a string with multiple attributes in it.

Characters whose positions are after start + length - 1 do not change color or attributes. Characters whose positions are before the start position must be initialized to the special hexadecimal character 'FF'x in order to maintain their current color and attribute. For more information about using hexadecimal characters, see FLDATTR.

To change the color for an entire text entry widget or field, use the FIELD function.


Example

Define an attribute string named STR that contains red reverse in the first half of the string and blue highlight in the second half. Apply the attribute string to the field ABC.

half=mlength(abc)/2;
str=strattr('red','reverse',1,half);
str=strattr('blue','highlight',half+1,half);
rc=fldattr('abc',str);


See Also

FLDATTR

FLDCOLOR

Previous Page | Next Page | Top of Page