Erase Statement |
Erase arraylist
arraylist
Use: Required
Data Type: Any
A list of array variables to clear.
Resets the elements of an array to their initial (unassigned) values. In short, Erase "clears out" or empties an array.
Specify more than one array to be erased by using commas to delimit arraylist.
Fixed array variables remain dimensioned; on the other hand, all memory allocated to dynamic arrays is released.
The following table describes how Erase reinitializes the elements of a fixed array.
Element Data Type | Element Reset to... |
---|---|
Numeric | Zero |
Variable-length string | Zero-length string ("") |
Fixed-length string | Zero |
Boolean | False |
Variant | Empty |
User-defined type | Each member of the user-defined type is treated as a separate variable |
Object | Nothing |
Once you use Erase to clear dynamic arrays, they must be redimensioned with ReDim before being used again. This is because Erase releases the memory storage used by the dynamic array back to the operating system, which sets the array to have no elements.