开发者

Erasing arrays in VB6

开发者 https://www.devze.com 2023-01-21 12:36 出处:网络
I am storing a jagged array of numbers in approximately the following way... Dim mainarray() as Variant

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消