在我的VB6应用程序中,我有一个声明的对象数组...
Dim MyArray() as MyClass
Run Code Online (Sandbox Code Playgroud)
随着处理的进行,该数组被填充
Set MyArray(element) = passed_object
Run Code Online (Sandbox Code Playgroud)
并且因为不再需要元素,
Set MyArray(otherelement) = Nothing
Run Code Online (Sandbox Code Playgroud)
使用数组时,我想使用类似的循环
For i = 1 To Ubound(MyArray)
If MyArray(i) <> Nothing Then ' Doesn't compile
...do something...
End If
Next i
Run Code Online (Sandbox Code Playgroud)
但我无法得到任何可能 - 想要编译.我也试过了
If MyArray(i) Is Not Nothing Then
Run Code Online (Sandbox Code Playgroud)
我是否应该这样做,如果是这样,我应该在这里进行什么测试?
| 归档时间: |
|
| 查看次数: |
43134 次 |
| 最近记录: |