Mat Assignment (Simple) - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

116
MAT array-name [(rows, [columns] ) ]
=
array-name
MAT ASSIGNMENT (SIMPLE)
The simple MAT assignment statement allows you to assign the elements of one
array to another array. The syntax of this statement is as shown:
MAT array-name [(rows, [COlumns])]
=
array-name
where:
array-name
is the name of the array.
rows, columns
are the redimension specifications for the first array (see
Redimen-
sioning Arrays,
Chapter 3).
Each element of the array specified to the right of the equal sign is assigned to the
corresponding element of the array specified to the left of the equal sign.
If redimension specifications follow the name to the left of the equal sign, the
truncated integer portion of each expression value in rows, columns is used to redi-
mension the array before values are assigned to it.
Notes About MAT (Simple)
• Both arrays specified must be the same type (arithmetic or character).
Both arrays specified in the array assignment statement must have identical dimen-
sions (after redimensioning, if any).
If redimension specifications are included, the rules described under
Redimen-
sioning Arrays
must be followed.
Example
The following example shows the execution of a MAT assignment (simple) statement:
20 DIM A(2,2),B(2,2)
100 MAT A
=
B

Advertisement

Table of Contents
loading

Table of Contents