Chapter Contents |
Previous |
Next |
STRATTR |
Category: | Widget or Field |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
cval=STRATTR(color,attribute,start,length); |
Type: Character
''
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
''
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
Type: Numeric
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 |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.