i have cleared the array by assigning null value can anyone suggest me to clear the array
how to clear an array dynamically
Collapse
X
-
[CODE=vb]
Sub Clear_Array()
Dim arr(2) As String
arr(1) = "Hello"
arr(2) = " World"
Debug.Print ">" & arr(1) & arr(2) & "<"
Erase arr
Debug.Print ">" & arr(1) & arr(2) & "<"
End Sub
[/CODE] -
the term "clear" is a bit vague - it may mean either of two things.
Assuming this is VB6 (don't know about later versions) you can use Erase to completely remove the array (so it no longer exists, doesn't take up any memory and cannot be used) or ReDim to simply clear the values but otherwise leave the array intact.Comment
Comment