The MAT command is used to either assign every element in a specified array to a single value or to assign the entire contents of one array to another. It takes the general form:
MAT Array = expression
MAT Array1 = MAT Array2
- Array, Array1 and Array2 are pre-dimensioned previously declared arrays,
- expression can evaluate to any data type.
If any element of the array Array2 has not been assigned a value then a runtime error message will occur. This can be avoided by coding the statement "MAT Array2 = " after the DIM statement.
An example would be as:
DIM ARR1(45), ARR2(45) MAT ARR2 = "Array value" MAT ARR1 = MAT ARR2 CRT DQUOTE(ARR1(45))
to display "Array value", even though it was initially assigned to A
Go back to jBASE BASIC.