1. ## Multidimensional Array

Hi,

I am trying to do something like this

Dim arrArray(4,4)
arrArray(0)= Array ("A1","A2","A3","A4")

I can use
arrArray(0,1)= "A1"
arrArray(0,2)= "A2"
arrArray(0,3)= "A3"
……………………
arrArray(n,j)= "An"

But I want to define one row at one point.

2. ## Re: Multidimensional Array

I have the solution now

Dim arrArray(3)

arrArray(0)=Array(“A1”, “A2”)
arrArray(1)=Array(“A1”, “A2”, “A3”)
………………..
arrArray(n)=Array(“A1”, “A2”)
msgbox arrArray(0)(0)

Let me know any better solution.

3. ## Re: Multidimensional Array

Hi,

Use 2 for loops,

Dim arrArray(4,4)

For i= 0 to 3

For J= 0 to 3
Next

Next

Thanks,
Ravi Allam

4. ## Re: Multidimensional Array

I'm having problem defining a multidimensional array. Don't know how to define it, or how to set elements in it. My reference say it's rarely used.. lol

I've tried this.

MyArray(4,19,0)?

Where 4 is 5 columns elements, 19 is 20 Rows elements and 0 is 1 element in the 3 dimension?

This is how my 2 dimension looks like

Movie1 : Director : Producer : Cast : n-more
Movie2 : Director : Producer : Cast : n-more
Movie3 : Director : Producer : Cast : n-more
.
.
.
Movie20: Director : Producer : Cast : n-more

But, in the array element "Director", "Producer", "Cast" and so on, I would like the third element. Call it "Haircolour"
So I would like the set up like this.

Movie1irector:Brown
Movie1:Producer:Blond
Movie1:Cast:Gray
Movie1:n-more:Bald

Movie2irector:Brown
Movie2:Producer:Green

And honestly I don't know how to insert the elements.
Any ideas?

Only one I got so far is making a SubArray of the Array itself. And insert the SubArray in the Array.

'******* Edited *******

Looks like this is working.

ReDim preserve combiArray(1,19)
combiArray(0,0) = "Movie1"
combiArray(0,1) = "SubArray(1,1)"
ReDim preserve SubArray(1,1)
SubArray(0,0) = "Director"
SubArray(0,1) = "Brown"
SubArray(1,0) = "Producer"
SubArray(1,1) = "Blond"

msgbox combiArray(0,0)
msgbox SubArray(0,0)
msgbox SubArray(0,1)
msgbox SubArray(1,0)
msgbox SubArray(1,1)

5. ## Re: Multidimensional Array

Had a little error in the array. I confused Columns with Rows.

The correct element insertion should be.

'First row
ReDim preserve combiArray(1,19)
combiArray(0,0) = "Movie1"
combiArray(1,0) = "SubArray(1,1)"
ReDim preserve SubArray(1,1)
SubArray(0,0) = "Producer1"
SubArray(1,0) = "Blond"
SubArray(0,1) = "Director"
SubArray(1,1) = "Gray"

'Second row
ReDim preserve combiArray(1,19)
combiArray(0,1) = "Movie2"
combiArray(1,1) = "SubArray(1,1)"
ReDim preserve SubArray(1,1)
SubArray(0,0) = "Producer2"
SubArray(1,0) = "Blond"
SubArray(0,1) = "Director2"
SubArray(1,1) = "Grey"

Third row.
ReDim preserve combiArray(1,19)
combiArray(0,2) = "Movie3"
combiArray(1,2) = "SubArray(1,5)"
ReDim preserve SubArray(1,5)
SubArray(0,0) = "Producer3"
SubArray(1,0) = "Black"
SubArray(0,1) = "Director3"
SubArray(1,1) = "Blond"
SubArray(0,2) = "CoDirector1"
SubArray(1,2) = "Bald"
SubArray(0,3) = "Cast"
SubArray(1,3) = "All"
SubArray(0,4) = "MakeupArtist"
SubArray(1,4) = "Brown"
SubArray(0,5) = "LightDirector"
SubArray(1,5) = "Brown"

.
.
.
Row 20

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.