MAT INPUT
array-name
[(rows
Lcolumnsl)
J[.array-name[(rows
[,columnsl
)J]
...
132
MAT INPUT
The MAT INPUT statement allows you
to
assign values
to
array elements from
the
keyboard without specifying each array element individually. The
MAT
INPUT
statement
can also be used
to
redimension arrays. The syntax
of
the
statement
is
as
shown:
MAT INPUT
array-name
[(rows
Lcolumnsl)
J
[.array-name
[(rows
Lcolumnsl
)J]
...
where:
array-names are character or numeric arrays.
rows, columns are the dimensions
of
the
arrays named. Only one array name
is
required and rows, columns
is
optional.
When a
MAT
INPUT
statement
is
executed, it causes a flashing question mark
to
be
displayed on line 1
of
the
display screen, and program execution
is
interrupted. You
must
then
enter a list
of
values
that
will be assigned row-by-rowto elements
of
the
specified arrays.
After each line
of
input (64 characters maximum) has been keyed, it must be
processed by pressing EXECUTE. If
the
array specified has
not
been filled,
the
question mark
is
displayed again
to
indicate
that
more input
is
required.
Character constants
that
contain less
than
18
characters are padded on
the
right
with blanks
to
a length
of
18
before being assigned
to
the
array element. Char-
acter constants
that
contain more
than
18 characters
a~e
truncated on
the
right
before being assigned. Character constants containing no characters (null) are
assigned
as
18 blank characters.
Notes
About
MAT
INPUT
• Each value entered must be
of
the
same
type
(character or numeric)
as
the
corresponding array element.
• Each value entered must be separated from
the
next value by a comma.
• The last value entered on a line can be followed by a comma or a blank.
•
If
the
number
of
data items entered exceeds
the
number
of
array elements
referred
to,
the
excess data items are ignored.
• Blanks within
numeric data items are ignored.
• Character data must be enclosed in single
quotation
marks.
•
If
redimension specifications are included,
the
rules under Redimensioning
Arrays,
Chapter 3, must be followed.