an array question
I'm going thru a book learning about web services, and i'm on the part about
returning arrays. Examine:
Dim myArray(2) as pcdebbArray
This is an array of TWO elements or THREE? The book states this is an array
of three items, I know it supposed to be zero based so when I reference them
it will be myArray(0), my Array(1), etc, but this really confused me?
Re: an array question
>Dim myArray(2) as pcdebbArray
Yes this can be confusing. That declaration is functionally identical to:
Dim myArray(0 to 2) as pcdebbArray
i.e. the 2 declares the Upper Bound of the array, when the array's lower
bound is 0.
The easiest way IMO to remember is just to mentally translate
Dim myArray(x) -> Dim myArray(0 to x).
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center