Tommaso,
Try something like:
Dim list As Array
Dim lengths() As Integer = {10, 10}
Dim lowerBounds() As Integer = {1, 1}
list = Array.CreateInstance(GetType(Integer), lengths, lowerBounds)
Dim values(,) As Integer = DirectCast(list, Integer(,))
For x As Integer = values.GetLowerBound(0) To
values.GetUpperBound(0)
For y As Integer = values.GetLowerBound(1) To
values.GetUpperBound(1)
values(x, y) = x * y
Next
Next
' this causes an exception!
Dim value As Integer = values(0, 0)
What I think misleads people is that most .NET languages (such as C# & VB)
only support creating 0 based arrays in their "native" syntax. If you use
the runtime itself, you can create an array with any lower bound...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
| hi GhostInAK
|
| can you make an example of what you mean by starting
| at a different index?
|
| -tom
|
| PS. btw array elements are not sexist
|
| GhostInAK ha scritto:
|
| > Hello (e-mail address removed),
| >
| > Most array's in .NET are 0-based. Hoever it is possible to create
arrays
| > which start at a different index.
| >
| > -Boo
| >
| > > is there a way to find out if the element exist ?
| > >
| > > dim myarray() as string
| > > dim mytxt as string
| > > mytxt ="Superman1,Superman2,Superman3,Superman4"
| > >
| > > myarray=mytxt.split(",")
| > >
| > > debug.print(myarray(4))
| > >
| > > theelemet myarray(4) doesn't exist how do i find out if it exist or
| > > not
| > > with out doing ubound or GetUpperBound
| > > thank you
|