How can I declare dynamic multidimensional arrays?
And how do I re-dim them afterwards?
Printable View
How can I declare dynamic multidimensional arrays?
And how do I re-dim them afterwards?
You dim them the same as a normal dynamic array. But, you can only re dim the second element, so the first time you re-dim it, make sure the first element is going to be big enough.
Are you sure I can only re-dim second element?
I tried it and it seems that I can redim both of them.
You can preserve only the last dimension (2nd if two dimensions, 3rd if three, etc.) when you redim. If this is too much of a constraint try nesting dynamic arrays.
Actually, I don't need to preserve any dimmension.
I just want to be able to re-dim both of them.
So if I don't need to preserve, can I re-dim with new dimmensions?
Yes, if you do not need the preserve the contents you can redim the array the whatever specification you need...