CLEARSELECT Statement

Clears a select list.

Syntax

CLEARSELECT {[list-number || fileSelectVar || indexSelectVar]}

Syntax Elements

list-number Must be 0. Specifies the active select list.

fileSelectVar The name of a variable containing a file select list assigned using the SELECT statement.

indexSelectVar The name of a variable containing an index pointer created using the SELECT statement.

If you do not specify a list, the internal default select variable is cleared.

Comments

Once a list has been cleared, any subsequent READNEXT statement that attempts to read from that list will execute the ELSE clause.

Examples

CLEARSELECT

Clears the internal default select variable.

CLEARSELECT 0

Clears the active select list.

X = 'B':AM:'C':AM:'D':AM:'E1':VM:'E2':VM:'E3'
ATTR4 = X<4>
SELECT ATTR4 TO VMLIST
READNEXT ID FROM VMLIST THEN
READ ITEM FROM CUSTF,ID ELSE ITEM=''
END ELSE ITEM=''
CLEARSELECT VMLIST

Assigns the list 'E1', 'E2', 'E3' to VMLIST and then assigns the string 'E1' to the variable ID and reads the contents of item E1 into the variable ITEM. Finally, the list VMLIST is cleared.