-
I have a variant dynamic array declared;
private vntArray() as variant
How can I test if it has been dimensioned.
Everything I try always gives me back <subscript out of range>. I could check in the error handler for this, but this is messy and not a nice way to do it.
Regards
Bill
-
well first, the only way it will be dimensioned is if you do it. What you could do, set a public boolean, setting it to false when prog starts. Then whereever you dimension it, set it to true. Then where ever you try to use it, check to make sure the boolean is true. It's not very elegant but it would work.
-
It's better to try to avoid using global variables. Here is code that will do what you want.
Code:
On Error Resume Next
vntArray(0) = vntArray(0)
If Err = 0 Then
MsgBox "I'm dimensioned"
Else
MsgBox "I'm not"
End If
------------------
Marty
HASTE CUISINE
Fast French food.