AdjustArray

Description: Changes the array information for a variable.
Warning: This function removes existing information from the array.
Returns: Nothing
Usage: Script Only.
Function Groups: Array,  Compilation and On-Line Modifications
Related to: ArrayOp1 | ArrayOp2 | New
Format: AdjustArray(Variable, NumDimensions, Start, Size)
Parameters:  
Variable
Required. Variable is any expression for the array to adjust.
NumDimensions
Required. Any numeric expression that gives the number of dimensions for the variable's multidimensional array.
Start
Required. Can be either a numeric expression or an array specifying the start for each of the dimensions.

If Start is a numeric expression, each of the dimensions will start at that value.

If Start is an array, then the Nth element in the array will correspond to the start of the Nth dimension (i.e. dimension 2 will start at start[2] ).
Size
Required. Can be either a numeric expression or an array specifying the size of each of the dimensions.
If Size is a numeric expression, each of the dimensions will be the size of that value.
If Size is an array, then the Nth element in the array will correspond to the size of the Nth dimension (i.e. dimension 2 will have a size of Size[2] ).
Comments: This statement takes a variable and gives it the array attributes specified by the parameters provided. It can also be used to take an array and make it a simple variable by specifying the number of dimensions as "0". Caution should be taken, as all information in the array will be lost when this statement is executed, even if the result is no change in the array's attributes.

Example:

elements[0] = 4;
elements[1] = 5;
...
AdjustArray(OldVariable, 2, 1, elements);

In this code example, the variable OldVariable is changed into a two-dimensional array with 4 rows and 5 columns. The elements for both the rows and columns will start numbering at 1 (as per the third parameter). This is the same as declaring:

OldVariable[1, 4][1, 5];