读书人

怎的知道collection是否为空

发布时间: 2013-06-19 10:26:41 作者: rapoo

怎样知道collection是否为空?
dim aaa as collection
msgbox aaa.count

用以上代码会出错,用isempty/isnull总是返回false,有什么办法呢,不然只有用on error resume next了?谢谢。 collection vb6
[解决办法]
Dim aaa As Collection
If ObjPtr(aaa) <> 0 Then
MsgBox aaa.Count
Else
Set aaa = New Collection
MsgBox aaa.Count
End If

读书人网 >VB

热点推荐