redim preserve multi dimensional array (1 Viewer)

Liv Manto

Registered User.
Local time
Today, 01:30
Joined
Apr 26, 2001
Messages
266
got an array

myarray(0,4) as variant.

I want 0 to be a redimmable

so I could go 0, 1 = a
0,2 = b
0,3 = c
0,4 = d

redim preserve myarray(0+1, 4)

how do you declare this array in the first place?

isnt it supposed to be an empty parentheses -- () in declaration.
 

ChrisO

Registered User.
Local time
Today, 10:30
Joined
Apr 30, 2003
Messages
3,202
Don’t know if this will help or not but there is an attachment in this thread that might.

Best of luck and regards,
Chris.
 

filo65

Registered User.
Local time
Today, 02:30
Joined
Oct 22, 2004
Messages
38
A possible solution:

Code:
Dim tmp() as Variant, myarray() as Variant
Dim i as Integer, j as Integer

i=0
redim tmp(4,i)
for j=0 to 4 Step 1
  tmp(j,i) = i *10 *(j+1)
next j

while i < 10
  redim preserve tmp(4,i+1)
  for j=0 to 4 Step 1
    tmp(j,i) = i *10 *(j+1)
  next j
wend


for i = 0 to 9 Step 1
  for j = 0 to 4 Step 1
    myarray(i,j) = tmp(j,i)
  next j
next i

HTH

filo65
 

Users who are viewing this thread

Top Bottom