I've been working on learning VBScript to make a few useful scripts to work with WinNT and make a more user friendly interface when searching for users on a domain. While doing so, I discovered something interesting about arrays and I'm hoping someone could explain if it's just the way microsoft made VB or if it's something else.
If I decalre an Dim myArray(2), one would think valid subscripts would be myArray(0) and myArray(1), but it's not.
Dim myArray(2) myArray(0) = "Hello" myArray(1) = "World" myArray(2) = " This should give an error" WScript.echo myArray(0) & " " & myArray(1) & myArray(2)
I would expect the above code to give an error, but it doesn't and it runs perfectly. Does VB allocate an extra subscript to accomodate "making sense" or is that last subscript location used for something else?