Microsoft® Visual Basic® Scripting Edition
Erase Statement
| Language Reference 
| Home | Site Map |

 
See Also
Description
Reinitializes the elements of fixed-size arrays and deallocates dynamic-array storage space.

Syntax

Erase array

The array argument is the name of the array variable to be erased.

Remarks

It is important to know whether an array is fixed-size (ordinary) or dynamic because Erase behaves differently depending on the type of array. Erase recovers no memory for fixed-size arrays. Erase sets the elements of a fixed array as follows:

Type of arrayEffect of Erase on fixed-array elements
Fixed numeric arraySets each element to zero.
Fixed string arraySets each element to zero-length ("").
Array of objectsSets each element to the special value Nothing

Erase frees the memory used by dynamic arrays. Before your program can refer to the dynamic array again, it must re-declare the array variable's dimensions using a ReDim statement.


© 1996 by Microsoft Corporation.