The original post had nothing to do with how a an array is declared. it was
about how the results of the Split function differed between VB6 and VB.NET.
That has been explained.
When arrays were introduced to BASIC, long before VB was a twinkle in Bill
Gate's eyes, the bounds were 1 based. This means that Dim x(10) As Integer
was the same as Dim x(1 To 10) As Integer. In those days, Dim x(10) As
Integer did, in fact, mean 'an array of 10 elements with subscripts 1 to 10
inclusive.
At some point in time, along came the Option Base statement where you could
declare that subscripts for your arrays were going to be 1 based or 0 based.
You could Use Option Base 0 or Option Base 1 as it took you fancy. If you
ommitted the Option base statement then it defaulted to Option Base 1.
If you used Option Base 0, Dim x(10) As Integer gave you an array of 11
elements subscripted by 0 to 10 inclusive and Dim x(0 to 9) As Integer gave
you an array of 10 elements subscripted by 0 to 9 inclusive.
The only, x(10), or last, x(0 to 10), part of the bounds clause has always,
in BASIC, determined the the upper bound of the array, NOT the number of
elements. It is coincidence that prior to Option Base the upper bound was
guaranteed to be the same as the number of elements.
As long as one 'thinks' BASIC when one is using BASIC then it is not
confusing at all. How one declares arrays in other languages is irrelevant.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Bill,
I agree with you that the array in VBNet has a very inconistent behaviour.
Confirm every other program language I know are "MyArray(10)" ten strings,
while it is in VBNet eleven strings. In my opinion is this ver confusing.
I therefore understand that when you say.
string() = string.split("")
Would expect at least 1 string because that would be than confusing
because string(0) = 1 string.
It would in my opinion be an improvement when this strange behaviour is
once banned from VBNet and that than 10 elements are really 10 elements
and not 11.
Just my thought,
Cor