MATBUILD

Top  Previous  Next

 

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

 

varis the variable to receive the dynamic array.

 

matis the matrix from which data is to be taken.

 

start.exprevaluates to the index of the first matrix element to be used. If omitted or less than one, this defaults to one.

 

end.exprevaluates to the index of the last matrix element to be used. If omitted or less than one, this defaults to the number of elements in the matrix.

 

delimiterevaluates to the delimiter to be used between elements of mat. This may be more than one character. If omitted, this defaults to the field mark.

 

 

The MATBUILD statement constructs a dynamic array by concatenating elements of mat from element start.expr to the last non-null element before element end.expr. The delimiter is inserted between each element. With the default style of matrix, if the zero element of mat is non-null, a delimiter followed by the content of the zero element is appended to the end of the resultant dynamic array. Pick style matrices do not have a zero element. See the COMMON and DIMENSION statements for more details.

 

 

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:

MATPARSE