MATBUILD |
|
|
The MATBUILD statement constructs a dynamic array from the elements of a matrix.
Format
MATBUILD var FROM mat {, start.expr {, end.expr} {USING delimiter}
where
The MATBUILD statement behaves differently depending on the matrix style.
For a default style matrix, MATBUILD constructs a dynamic array by concatenating elements of mat in the range start.expr to end.expr, inserting delimiter between each element. If the zero element is null or unassigned, trailing null elements are ignored. If the zero element is not null, trailing null matrix elements are included and followed by a delimiter and the content of the zero element.
For a Pick style matrix, MATBUILD constructs a dynamic array by concatenating elements of mat in the range start.expr to end.expr, inserting delimiter between each element. Trailing null or unassigned elements are ignored. Pick style matrices do not have a zero element. See the COMMON and DIMENSION statements for more details.
In either style, use of the INMAT() function immediately after MATBUILD will return the index value of the final element included. If the zero element of a default style matrix was non-null, INMAT() will return zero.
Example
MATBUILD REC FROM A USING @VM
This statement constructs dynamic array REC from the elements of matrix A, separating each element by a value mark.
See also: |