Chapter Contents |
Previous |
Next |
DEVLIST |
Category: | Selection List |
Syntax | |
Details | |
Examples | |
Example 1: Displaying the Printer Devices of a Catalog | |
Example 2: Using the Results of a DEVLIST | |
See Also |
Syntax |
selections=DEVLIST(catalog-name,device<,message
<,autoclose<,num-sel>>>); |
Type: Character
Type: Character
'CAMERA'
'DEFAULT'
'EXPORT'
'MONITOR'
'PLOTTER'
'PRINTER'
Type: Character
Type: Character
'Y' |
closes the window automatically. (This is the default.) |
'N' |
leaves the window open until the user explicitly closes it. |
This option is ignored when num-sel
is not 1. However, use ''
as a placeholder
if you are also specifying a value for num-sel.
Type: Character
Type: Numeric
Details |
The value in selections consists of a 40-character description, an 8-character device name, and an 8-character device type. For additional details about graphic device drivers, see SAS/GRAPH Software: Reference and the SAS online Help for SAS/GRAPH software.
You can provide a default value or an initial selected value in the list by providing a value for the selections variable before calling DEVLIST. If selections contains valid entry names when the function is invoked, those names are automatically designated as selected when the selection list is displayed.
If a user closes the selection list window without making a selection, then DEVLIST returns a blank value unless there was an initial value for the selections variable before DEVLIST was called.
When multiple selections are allowed, selections contains the first value selected from the list. However, the values for all selections can be returned 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 selected from a selection list. To use a current result list, use the MAKELIST function to create the list, and use the CURLIST function to designate it as the current result list. The current result list must exist before you call DEVLIST.
When DEVLIST is invoked, the current result list is cleared. After DEVLIST is invoked, the result list contains the following named items:
Type: Character
Type: Numeric
Type: Character
Type: Character
Type: Character
Examples |
Display a list of devices of type PRINTER that are available in the catalog SASHELP.DEVICES. After the user selects one device from the list, the program uses the SUBSTRING function to extract the individual items of information returned by DEVLIST.
select=devlist('sashelp.devices','printer', 'Select a device.'); descript=substr(select,1,40); device=substr(select,41,8); devtype=substr(select,49,8);
Use the current result list to process multiple selections:
listid=makelist(); rc=curlist(listid); selection=devlist('sashelp.devices','printer', 'Select a device',' ',3); n=getnitemn(listid,'COUNT'); do i=1 to n; descript=getnitemc(listid,'DESC',i); device=getnitemc(listid,'DEVICE',i); devtype=getnitemc(listid,'TYPE',i); put descript= device= devtype=; end;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.