Please enable JavaScript to view this site.

A-Shell Development History

Compiler/language enhancement: A new statement has been defined to redimension an array originally created with DIMX:

DIMX VARNAM(SUB1,...,SUBn),<type>,<size>

...

REDIMX VARNAME(SUB1,...SUBn)

 

Notes

The REDIMX statement must occur after the corresponding DIMX (both during compilation and at runtime). If the compiler sees the REDIMX first, it will report an unmapped variable. If the runtime sees the REDIMX first, it will report error 30 (redimensioned array - same error as you get when attempting to use DIMX a second time).
You cannot change the number of subscripts; you can only change the maximum value(s) of the subscript(s).
The REDIMX statement can not specify a variable type or size; thus you cannot change the original type or size.
The original contents of the array will be preserved ONLY if the all dimensions beyond the first (for multi-dimensioned arrays) are preserved. For example, if you start with DIMX A(P,Q,R), and then redimension using REDIMX A(X,Y,Z), the contents will be preserved only if Y=Q and Z=P (i.e. if the only dimension changed in the first dimension).
The MALLOC trace option will trace DIMX and REDIMX memory allocations (along with most other memory allocations/deallocations), making it a useful debugging tool.