Using UBound on empty array
Posted on 2004-10-13
I am doing something similar to the following:
'Some code that may ReDim myArray to some new size
If UBound(myArray) > 0 Then
If I make it to the line that checks UBound and nothing has yet been added to the array, I get the following error:
Microsoft VBScript runtime error '800a0009'
Subscript out of range: 'UBound'
How can I find out the size of my array when there is a possibility that the array may have no values?