I am storing a jagged array of numbers in approximately the following way...
Dim mainarray() as Variant
Dim smallarray() as Integer
ReDim mainarray(fairly_large_size)
For i = 1 to fairly_large_size
ReDim smallarray(some_variable_moderate_size)
'fill in smallarray
mainarray(i) = smallarray
Next i
The question is, when I come to erase the main array, is erasing that array sufficient to reclaim all the memory invol开发者_如何学JAVAved in it, or do I have to erase each of its elements first?
If you did, VB would somewhat fail its purpose.
No, erasing the outer array is fine. Whatever is inside (could also be COM objects for instance) will be released properly.
精彩评论