Right now I use an error trapping trick to do it, like this:
But I'm still annoyed VB has no way to look at an empty array or count the number of dimensions easily.
Are there any other tricks you guys use to get this done?
Code:
Public Function TestUBound(myArray As Variant) As Long
On Error Resume Next
Dim size As Long
size = UBound(myArray)
If Err = 9 Then
TestUBound = -1
Else
TestUBound = size
End If
End Function
Are there any other tricks you guys use to get this done?