# 请教 collection 清空问题

Posted by Eric on September 24, 1998 at 10:25:20:

如果我用了一个 Test 的外部 Collection 变数, 程式如下
当我于 Command1_Click 用后
于 Command2_Click 想清空 Collection
我需要 Set Test = Nothing 吗?
如果不 Set Test = Nothing ,会不会造成记忆体没有释放

Dim Test As New Collection

Private Sub Command1_Click()
Test.Add "aa"
Test.Add "bb"
End Sub

Private Sub Command2_Click()
Set Test = Nothing '需要吗?
Set Test = New Collection
Test.Add "bb"
Test.Add "cc"
End Sub

Follow Ups:

- Re: 请教 collection 清空问题 小季 14:01:33 9/25/98 (0)