Description

Assigns the value of each successive element in a matrix to successive elements in a dynamic array.

Syntax

array = MatUnparse(matrix)

Parameters

The MatUnparse function has the following parameters.

ParameterDescription
matrixAny matrix name. The matrix name must have been dimensioned by a Dimension statement before using MatUnparse. The data contents of each element in the matrix will become the data contents of a field in the dynamic array. The first element will be assigned to the first field, the second element will be assigned to the second field, and so on. If there is a dynamic array in a matrix element, it is assigned as a unit when that element is assigned to the variable.

MatUnparse is useful when the contents of an undersized matrix are to be moved to a correctly sized matrix.

Example

* Using MatUnparse...
/* because my array has more fields than Z has dimensions, Z(4) will contain all overflow fields and their corresponding @RM
marks */
Dim Z(4)
MY_ARRAY=10:@RM:20:@RM:30@RM:40@RM:50
MatParse MY_ARRAY Into Z using @RM
* calcs. how many additional dimensions are required for Z
CNT=COUNT(Z(4), @RM)
Dim NEW_Z(4+CNT)
* converts Z back into a dynamic array
NEW_ARRAY=MatUnparse(Z)
* fill correctly dimensioned NEW_Z with fields from NEW_ARRAY MatParse NEW_ARRAY into NEW_Z
  • No labels