Erase Instruction


Erase arrayvar[, ...]


Erase usertypevar.elem[, ...]

Group: Assignment

Reset arrayvar or user defined type array element to zero. (Dynamic arrays are reset to undimensioned arrays.) String arrays values are set to a null string. arrayvar must be declared as an array.

• Declare with Dim, Private, Public or Static.

• Declare as a parameter of Sub, Function or Property definition.


Sub Main

Dim X%(2)

X%(1) = 1

Erase X%

Debug.Print X%(1) ' 0

End Sub