Previous Page | Next Page

SAS Component Language Dictionary

SHOWLIST



Displays a selection list window that contains up to 13 items, and returns the user's selections
Category: Selection List

Syntax
Details
Example
See Also

Syntax

selection=SHOWLIST(item-1<, . . . ,item-13>,message);

selection

contains the selected items, or a blank if no selection is made. By default, selection is 200 bytes long. To accommodate values longer than 200 bytes, explicitly declare selection with a longer length.

Type: Character

item

lists up to 13 items, separated by commas, for the selection list.

Type: Character

message

is the text for a message to display above the selection list. Regardless of how many item values are supplied, the last argument is assumed to be the message. Use a null string ('' ) to specify the default message, which instructs users to make one selection.

Type: Character


Details

SHOWLIST automatically displays a custom selection list and returns the user's selections. Only one user selection is allowed, and the selection list window closes automatically after the user makes a selection.

You can provide a default or initial selected value in the list by assigning a value to selection before executing SHOWLIST. If selection contains a value that corresponds to one of the item arguments when SHOWLIST executes, then that selection is designated as selected when the selection list is displayed.

If a user closes the selection list window without making a selection, SHOWLIST returns a blank value unless there was an initial value for selection before SHOWLIST was called.


Example

Open a selection list window that displays a list of three colors:

color='BLUE';
color=showlist
('RED','BLUE','GREEN','Please select a color.');

Because a value is assigned to the variable COLOR before SHOWLIST executes, and the value BLUE is one of the arguments for SHOWLIST, the item BLUE in the list is highlighted with an asterisk when the list is displayed.


See Also

DATALISTC and DATALISTN

LISTC and LISTN

Previous Page | Next Page | Top of Page