redim preserve multi dimensional array

Liv Manto

Registered User.
Local time
Today, 16:09
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.
 
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.
 
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

Back
Top Bottom