Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting at the Index of an Array Inside and Array

Status
Not open for further replies.

RITE1

IS-IT--Management
Oct 25, 2003
91
US
Hello,

Im trying to get to the index of an array inside an array. Here is some code to illistrate.

Dim SubArray1(,) = {{a, 1}, {b, 2}}
Dim SubArray2(,) = {{g, 5}, {h, 6}}

Dim MainArray() = {SubArray1, SubArray2}

dim i as integer

For i = 1 to 3
MainArray(i(i,0)) = whatever (????????)
next i

How do I access the SubArray indexes from the MainArray? Is there a better way to do this?

Thanks for the help!!



Rick Feuling
 
Try:
Code:
Dim a1 As String(,) = {{"a", "b"}, {"c", "d"}}
Dim b1 As String(,) = {{"1", "2"}, {"3", "4"}}
Dim c1 As String(,)
Dim m1() = {a1, b1}
  c1 = m1(0)
  c1(0, 0) = "c"

-Rick

----------------------
 
I thought of that like two seconds before I recieved you post - something very much like that worked.

Thanks Rick!!

Rick Feuling
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top