Purpose:Remove array variables


Format:UNSETARRAY [/Q] name [name...]




nameOne or more array variables to remove (wildcards accepted).




See also: SETARRAY.




UNSETARRAY removes one or more array variables.


For example, to remove the array variable ARRAY1:


unsetarray array1


If you use the command UNSETARRAY *, all of the array variables will be deleted:


unsetarray *


You can delete all matching array variables except for those specified by enclosing the exceptions in parentheses. For example, to remove all array variables beginning with "v" except for var1 and var2:


unsetarray (var1 var2) v*


For more information on array variables, see the SETARRAY command.




/QPrevents UNSETARRAY from displaying an error message if one or more of the array variables do not exist. This option is most useful in batch files, for removing a group of arrays when some of the arrays may not have been defined.