Chapter Contents

Previous

Next
CURLIST

CURLIST



Designates or reports the current result SCL list

Category: List


Syntax
Details
Example
See Also

Syntax

list-id=CURLIST(<new-list-id>);

list-id
is the identifier of the list to receive the values returned by the next SCL selection list function that is invoked.
>0 is the list identifier of the SCL list that was previously defined as current with the CURLIST function.
0 indicates that no list is defined as the current list.
Type: Numeric or List

new-list-id
is the identifier of the list to be designated as the current list. An invalid new-list-id produces an error condition.

Type: Numeric


Details

When a value is provided for new-list-id, CURLIST designates the SCL list that is identified by new-list-id as the current result list. New-list-id must be the list identifier that was returned by the MAKELIST, MAKENLIST, or COPYLIST function that created this list. If you omit new-list-id, then CURLIST returns the identifier of the SCL list that was already designated as the current result list by CURLIST. If no argument is passed to CURLIST and no current result list has been specified, CURLIST returns 0.

The current result list is filled automatically with the values that are selected when the next SCL selection list function executes.

The functions that can fill the current result list are the SCL selection list functions CATLIST, COLORLIST, DATALISTC, DATALISTN, DEVLIST, DIRLIST, FILELIST, LIBLIST, LISTC, LISTN, LVARLEVEL, and VARLIST. For example, CATLIST opens a selection list window that displays the names of catalog entries. The value returned by CATLIST is a character string containing each catalog name that users select, separated by blanks. Selection list functions like CATLIST can also automatically fill the current result list, as specified by CURLIST, with a character item for each selection that users make. The length of that list is unbounded.

When one of the selection list functions is invoked, the values that users select replace the entire contents of the current result list. To preserve the contents of the current result list, use COPYLIST to copy the list before calling another selection list function.


Example

Set up a selection list, invoke a selection list function, and access the selections:

clist=makelist();
oldcurlist=curlist(clist);
   /* Allow user to choose up to 16 graphs.  */
graphs=catlist('SASUSER.DEMO','GRSEG',16,'Y');
n=getnitemn(clist,'COUNT');
do g=1 to n;
      graphName=getnitemc(clist,'name',g);
     put 'Selection #' g ' is ' graphName;
end;
/* Delete temporary curlist and restore +/
/* previous curlist. */
rc=dellist(clist);
oldcurlist=curlist(oldcurlist);

See Also

CATLIST

COLORLIST

COPYLIST

DATALISTC and DATALISTN

DELLIST

DEVLIST

DIRLIST

FILELIST

LIBLIST

LISTC and LISTN

LVARLEVEL

MAKELIST

MAKENLIST

PUTLIST

VARLIST


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.