CLEAR {{EXCEPT} varlist}
The CLEAR verb is a reset/initialize verb that first performs a RESET and clears the current user data. When used without parameters, the CLEAR verb performs a RESET and clears the current user data. When used with parameters, the verb clears one or more variables, including arrays.
|
Parameter |
Description |
|
EXCEPT |
List of variables that are not to be cleared. It should be comprised of simple variables. ARRAY[ALL] and ARRAY$[ALL] are permitted to prevent an array from being cleared. |
|
varlist |
List of variables to be cleared. When CLEAR is used with just a variable, then only that variable is cleared from memory. |
See the RESET verb for additional information on the levels of reset verbs.
Executing a CLEAR after an ENTER has the following effect on arguments passed through the ENTER:
Call-by-value arguments are cleared like normal data.
Call-by-reference arguments lose their links to the calling program and are then cleared. The values from before just before the CLEAR will be passed back to the calling program on the EXIT.
The following illustrates the use of CLEAR in console mode:
CLEAR
The following illustrates a simple CLEAR statement:
0100 CLEAR
The following illustrates a CLEAR statement using the EXCEPT clause to exclude certain variables from the CLEAR:
0100 CLEAR EXCEPT TOTAL,PAGE_NUM,DATE$,J[ALL]