WTF VB6! Part 10I've just stumbled on this one. It is not bad, actually, it is so amazing that the WTF above means "Wait - That's Fantastic!"
Take a look at the image below:
The Len function is used to get the size of an element from the array. As it is an array of Integers, it prints 2.
There's only one little, tiny, minuscule detail: We are supposedly accessing its zeroth element.
But our array does not start at zero! Even so, we don't get a "Subscript out of range" error!
I tested it, and you can use any number at all: -1, 1000, whatever. It Just Works (™)!
It works even when the array is not initialized, as in Dim Months().
Next week we'll see how to suffer prejudice in two easy steps.