SAS Component Language Dictionary |
Category: | Selection List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
selections=COLORLIST(color-set,num-sel<,message <,autoclose>>); |
contains one or more user selections from the list. Multiple selections are separated by blanks. By default, selections is 200 bytes long. To accommodate values longer than 200 bytes, you should explicitly declare selections with a longer length.
specifies the set of colors to display in the selection list:
is the maximum number of items that a user can select from the list. To display the list for information purposes only (no selections allowed), specify 0. To specify an unlimited number of selections, use a value such as 9999 that is larger than the number of available selections. A user cannot make a number of selections that exceeds the number of items in the list.
is the message text to display above the selection list. The default message tells users to make up to the number of selections specified in num-sel.
specifies whether the selection list window closes automatically after a user makes a selection when only one choice is allowed:
'Y' | |
'N' |
Details |
By default, the message above the selection list asks the user to make num-sel selections. Also by default, the selection list window closes when the user makes a choice and presses ENTER if the selection list allows only one choice.
The item in the selection list window enables you to specify characters that a value in the list contains. If the value is found, it is displayed as selected. If the value is not found, a message is displayed in the selection list window.
You can provide default values that will be initially selected when the color selection list is displayed. To do this, assign the values to the selections variable before calling COLORLIST.
If a user closes the selection list window without making a selection, COLORLIST returns a blank value unless there was an initial value for the selections variable before COLORLIST was called.
Selections from the window can be placed in the current result list, if one is available. The current result list is a special SCL list that is automatically filled with the values that are selected from a selection list. To use a current result list, use the MAKELIST function to create it, and use the CURLIST function to designate it as the current result list. The current result list must exist before you call the COLORLIST function.
You can use COLORLIST to enable a user to interactively design the RGB components for a color. If a user designs a color that is not supported on that device, SCL uses the closest color that is supported.
When COLORLIST is invoked, the current result list is cleared. After COLORLIST is invoked, the result list contains one element for each selected color name. The selections can be retrieved by using GETITEMC.
Example |
Display a list of devices of type MONITOR that are available in the catalog SASHELP.DEVICES and allow users to select a device. Users can choose up to four colors from the selection list. If no device is chosen, display a list of all possible colors.
usrdev=devlist('sashelp.devices','monitor', 'Select a device. '); device=substr(usrdev,41,8); devcolor=colorlist(device,4);
Use a current result list to process multiple selections:
listid=makelist(); rc=curlist(listid); selection=devlist('sashelp.devices','monitor', 'Select a device.'); device=substr(selection,41,8); devcolor=colorlist(device,4); n=listlen(listid); do i=1 to n; color=getitemc(listid,i); put color=; end;
Display a color selection dialog window:
color=colorlist('?',1,'Design a color for the bars');
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.