Mat Read - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

(
(
(
(
MAT READ array-name 8rows [,columns]
I]
[.array-name [(rows [,columns]
I]] ...
MAT READ
The MAT READ statement allows you to assign values from the data table (estab-
lished by DATA statementsl to the elements of an array without referring to each
individual array element. You can also use the MAT READ statement to redimen-
sion arrays. The syntax of the MAT READ statement is as shown:
MAT READ array-name 8rows [,columns]
I]
[.array-name [(rows [,columns]
I]] ...
where:
array-name
is the name of a numeric or character array. Only one array name is
required.
rows, columns
are the optional redimension specifications for the array.
At the beginning of program execution, a pointer is set to the first value in the data
table. When a READ or MAT READ statement is encountered, successive values from
the data table are assigned to the variables or array elements in a READ statement, or
to entire arrays in the MAT READ statement. The values are assigned to the array
by rows, beginning at the current position of the data table pointer. The data table
pointer can be reset by use of the RESTORE statement.
If a redimension specification follows the array name, the truncated integer portion
of each value in rows and columns is used to redimension the array before values
are assigned to it.
Notes About MAT READ
• Before being used in a MAT READ statement, arrays must have been previously
defined, either implicitly, or explicitly in a USE or DIM statement.
• If the data table is exhausted and unassigned arrays or array elements remain in
the MAT READ statement, an error occurs.
• If there are no DATA statements in the program, the MAT READ statement
will cause an error.
• The MAT READ statement cannot be used in a program assigned to one of the
function keys. This will cause an error when the function is executed.
• If redimension specifications are entered, the rules under
Redimensioning Arrays,
Chapter 3, must be followed.
141

Advertisement

Table of Contents
loading

Table of Contents