DIMX enhancement (requires compiler 460+): arrays may now be declared as auto-expanding by adding the "AUTO EXTEND" keyword to the end of the DIMX statement:
DIMX ARY(10,30),S,25,AUTO_EXTEND
The above allocates the array to the initial size of 10x30, but allows the array to expand (in the first dimension only!) during an assignment, e.g.:
ARY(17,20) = "Test expansion" ! this would expand ARY to 17x30
ARY(10,45) = "Bad subscript" ! this fails (2nd dimension too big)
Notes
In actuality, the first statement above would expand the array to somewhat more than 17x30, to reduce the number of expansions likely when filling out an array to an unknown size. But that should be transparent. . You can use the MALLOC trace to monitor the underlying memory allocation and deallocation opeations associated with arrays.
DIMX, REDIMX and auto-expansion operations are all limited by the MALLOCLIMIT setting in the miame.ini (defaults to 8MB).
When an array is created with DIMX, or expanded, whether by REDIMX or by the AUTO_EXTEND mechanism, the new space will all be cleared to nulls.