MAT

MAT


masking Index Level MATBUILD
Syntax MAT array.variable = expression
{MAT} array.variable1 = {MAT} array.variable2
Category BASIC
Type Statement
Description assigns data to each element of a dimensioned array variable to a specific value in one operation.

Array variables must be defined in a "dim", "common", or "file" statement.

{mat} array.variable1 = {mat} array.variable2

Copies one array into another. The number of elements in "array.variable1" must be less than or equal to the number of elements in "array.variable2". It is possible to assign a two-dimensional array to a single-dimensional array, and vice-versa.
Options
See Also assignment statements & functions DIM MATREAD MATWRITE
Example mat customer.item = ""

This sets every array element of "customer.item" to null.

mat customer.item.history = mat customer.item

This sets every array entry of "customer.item.history" to its corresponding entry in "customer.item".

dim a(10,2)
dim b(20)
mat b = 1
b(3) = 2
mat a = mat b

This example assigns all of the element in the two dimensional array, "a" into the one dimensional array, "b". The rows are "filled" before the columns, therefore a(2,1) = 2.
Warnings When assigning one matrix to another, the array on the right side of the equal sign must have the same total number of elements as the matrix on the left side of the equal sign.
Compatibility D3 7.0 AP R83
masking Index Level MATBUILD