if the array has never been allocated then it is NOTHING. If it is allocated but empty then the upperbound is -1. To eliminate NOTHING, allocate with upperbound of -1.
Dim ary1Str() as string ' Nothing
Dim ary2Str(-1) as string ' array with No elements
I use (-1) unless I have a size in mind to avoid problems.
Having to do it. I find it simpler to Dim ary1str(-1). It will pass right through
For I = 0 to Ubound(ary1Str)
....
Next
if ary1Str Is Nothing then Ubound(ary1Str) throws an error.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.