2 ms·
Well, Empty is a special value in VBA. And I forgot to mention, there are two kinds of "empty" arrays that are not Empty. So it's six times as good as a normal
by perl4ever 7y ago
Well, Empty is a special value in VBA. And I forgot to mention, there are two kinds of "empty" arrays that are not Empty. So it's six times as good as a normal
language.
Here's an example:
' x can be anything, including an array, but
' defaults to the value Empty.
Dim x
' y is an array of values that can be anything,
' which defaults to an empty array.
Dim y()
' Initialize x as an empty array
x = Array()
' The following two statements print 0 and -1.
Debug.Print LBound(x)
Debug.Print UBound(x)
' The following two statements error with
' "Subscript out of range" even though y
' is also a kind of empty array.
Debug.Print LBound(y)
Debug.Print UBound(y)