4 ms·
> arrays that are not Empty but contain zero elements What is an array that is not empty but contains zero elements?
by speedplane 7y ago
> arrays that are not Empty but contain zero elements
What is an array that is not empty but contains zero elements?
- saagarjha 7y agoSounds like a trick question. How about the array of the largest number?
- anonymfus 7y agoIIRC in Visual Basic these are arrays with lower bound bigger than upper bound.
- perl4ever 7y ago...but sometimes you can observe this and sometimes you can't.
- perl4ever 7y agoWell, 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)