Updated 2018-08-12 06:04:46 by pooryorick

array unset unsets variables in an array.

Synopsis  edit

array unset arrayName ?pattern?

Description  edit

Unsets all of the variables in the array that match pattern (using the matching rules of string match). If arrayName isn't the name of an array variable or there are no matching variables in the array, no error will be raised. If pattern is omitted and arrayName is an array variable, then the command unsets the entire array. The command always returns an empty string.

Note that this is only available from Tcl v8.3 onwards; see Arrays / Hash Maps for methods of clearing arrays in earlier versions of Tcl.


Because it is prevalent in the sqlite api for tcl it may become necessary to unset an array index that is literally "*". Use normal string match escaping, such as one of these forms:
array unset  x \[*\]
array unset  x {[*]}
array unset  x \\*
array unset  x {\*}