Caché MultiValue Basic Reference
MAT
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Assigns values to all the elements in a dimensioned array.
Synopsis
MAT array = value

MAT array1 = MAT array2
Arguments
array Name of an existing array. This array must have been dimensioned using the DIM statement.
value The value to assign to all of the elements of the array. An expression that resolves to a value.
Description
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:
Note:
This statement cannot be executed from the MVBasic command shell. Attempting to do so results in a MVBasic syntax error.
Emulation
D3 supports array1 = MAT array2 as functionally equivalent to MAT array1 = MAT array2.
Examples
The following examples illustrate the use of the MAT statement:
! Dimension a one-dimensional array with 6 elements.
DIM MyVector1(6)
! Dimension a one-dimensional array with 10 elements.
DIM MyVector2(10)
! Assign the value "pending" to all elements of MyVector2
MAT MyVector2="pending"
! 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"
See Also