Redim of Public Array Within Class Results in Loss of Dimensions
Posted on 2013-06-20
I am using Redim in a class on a two-dimensional array that is defined as public in a "declarations" module. However, depending on where the program flow is after the Redim, there can be a loss of dimensions. The pattern is that when I instantiate another object (class) within this class, then run the small process in that new object and come back the dimensions of the public array are lower. Thus if the new object was never instantiated to go out and do work, the results are confirmed that loss of elements doesn't occur.
For my example, the Redim is A(20,1) but after using the instantiated class to do a small outside job (outside of this class we are in -->with the Redim) the dimensions are A(19,0).
There are rules for Redim based on where it is used, so my question is how can I retain declaring a public array in a declaration module, and then use Redim on those arrays within instantiated objects (classes) without losing dimensions?