Assigns values to all the elements in a dimensioned array.
MAT array = value
MAT array1 = MAT array2
||Name of an existing array. This array must have been dimensioned using the DIM statement.
||The value to assign to all of the elements of the array. An expression that resolves to a value.
statement assigns values to all of the elements of a specified array. This array may be one-dimensional or two-dimensional. MAT
has two forms:
MAT array1=MAT array2
assigns the values of the elements in array2
to the corresponding elements in array1
. Both array1
must already have been dimensioned using the DIM
statement. The arrays may be differently dimensioned. If there are more elements in array2
, the excess array2
elements are ignored. If there are more elements in array1
, the excess array1
elements are not assigned a value. All uninitialized variables are treated as zero-length strings ("").
This statement cannot be executed from the MVBasic command shell. Attempting to do so results in a MVBasic syntax error.
The following examples illustrate the use of the MAT
! Dimension a one-dimensional array with 6 elements.
! Dimension a one-dimensional array with 10 elements.
! Assign the value "pending" to all elements of MyVector2
! Assign the values of elements of one array to another array
MAT MyVector1=MAT MyVector2
! Results are a that MyVector1 contains 6 elements all assigned
! the value "pending"
© 1997-2019 InterSystems Corporation, Cambridge, MA