K
ker_01
This is a repost of an earlier question that didn't recieve responses (my
question may have been too obscure).
I have a 3D array which I'll call myarray(1 to 10, 1 to 100, 1 to 3)
I would like to reduce the number of parameters to turn it into a 2D array
which I'll call mynewarray(1 to 10, 1 to100) while keeping the data that is
already in the array.
Redim/preserve only allows you to mess with the last dimension (1 to 3),
which is fine- but from help:
"Similarly, when you use Preserve, you can change the size of the array only
by changing the upper bound; changing the lower bound causes an error"
The data I'd like to preserve is in the middle, e.g. mynewarray(x, y) =
myarray(x,y,2)
Is there a better method, or will I be forced to loop through and build
mynewarray one value at a time? The real problem is that in my larger loop
of code, myarray is dynamic and is updated frequently, and I'll have to pull
current copies of mynewarray fairly often, and that seems like a lot of
processing overhead. If there is a way to redim the array directly, that
would save me all kinds of time.
Thanks!
Keith
question may have been too obscure).
I have a 3D array which I'll call myarray(1 to 10, 1 to 100, 1 to 3)
I would like to reduce the number of parameters to turn it into a 2D array
which I'll call mynewarray(1 to 10, 1 to100) while keeping the data that is
already in the array.
Redim/preserve only allows you to mess with the last dimension (1 to 3),
which is fine- but from help:
"Similarly, when you use Preserve, you can change the size of the array only
by changing the upper bound; changing the lower bound causes an error"
The data I'd like to preserve is in the middle, e.g. mynewarray(x, y) =
myarray(x,y,2)
Is there a better method, or will I be forced to loop through and build
mynewarray one value at a time? The real problem is that in my larger loop
of code, myarray is dynamic and is updated frequently, and I'll have to pull
current copies of mynewarray fairly often, and that seems like a lot of
processing overhead. If there is a way to redim the array directly, that
would save me all kinds of time.
Thanks!
Keith