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.
The MAT 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 array=value assigns the same value to every element of the array.
MAT array1=MAT array2 assigns the values of the elements in array2 to the corresponding elements in array1. Both array1 and array2 must already have been dimensioned using the DIM statement. The arrays may be differently dimensioned. If there are more elements in array2 than array1, the excess array2 elements are ignored. If there are more elements in array1 than array2, 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.
D3 supports array1 = MAT array2 as functionally equivalent to MAT array1 = MAT array2.
The following examples illustrate the use of the MAT statement:
! 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"