HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4-: 81
320 !
330 DATA 10,20,30,40
340 DATA 1,2,3,4,5,6,7,8
999 END
MAT INPUT
The MAT INPUT statement accepts values from the terminal keyboard to one
or more arrays. If new dimensions are specified for the arrays, the MAT
INPUT statement redimensions them before assigning values to them. It
assigns values element by element, in row-major order.
Syntax
MAT INPUT
array
[
dims
][,
array
[
dims
]]...
Parameters
array
Structured collection of variables of the same type.
The structure is determined when the array is declared.
String variables names are suffixed with a "$".
dims
Array dimensions used in syntax specification
statements. Its syntax is
(
dim1
[,
dim2
[,
dim3
[,
dim4
[,
dim5
[,
dim6
]]]]])
where
dim1
through
dim6
each have the syntax
[
num_expr1
:]
num_expr2
and
num_expr1
and
num_expr2
are the lower and upper
bounds (respectively) of the dimension. If
num_expr1
is
not specified, it is the default lower bound.
Examples
100 MAT INPUT A,B,C$
120 MAT INPUT D$
If array A has four elements, the following statements are equivalent:
100 MAT INPUT A
100 INPUT A(*)
100 INPUT A(1),A(2),A(3),A(4)
100 INPUT (FOR I=1 TO 4, A(I))
When reading from the terminal keyboard, the MAT INPUT statement prompts
for input with a question mark (?). Respond to the prompt by typing a
list of values. Separate values with a comma. Press RETURN to store the
values. The MAT INPUT statement prompts for input until it has assigned
a value to every array element.
The behavior of the MAT INPUT statement follows the general behavior of
the INPUT statement, described in chapter 6.
If A is
0 0
0 0
before the statement
10 MAT INPUT A
executes, and the response to the statement is
?2,4 RETURN