HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 82
? RETURN
?8 RETURN
then A is:
2 4
0 8
MAT PRINT
The MAT PRINT statement prints one or more arrays to the standard list
device or a data file. It prints them element by element, varying the
rightmost subscript fastest.
Syntax
For printing to a string variable or the standard list device:
[{,} ] [,]
MAT PRINT
array
[{;} array]...[;]
For printing to a data file:
[{,} ] [{,} ]
MAT PRINT
#fnum
[,
rnum
[,
wnum
]];
array
[{;}
array
]...[{;} END]
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 "$".
fnum
File number of a data file. For more information, see
"File Identification," in chapter 6.
rnum
Record number. If specified, the statement performs a
direct write on the data file specified by
fnum
. For
more information on rnum and direct reads, see "File
Input and Output," in chapter 6.
wnum
Word number. If specified, the statement performs a
direct word write on the file specified by fnum. That
file must be a BASIC DATA file. For more information on
rnum
and direct word reads, see "File Input and Output,"
in chapter 6.
{,|;} Determines spacing between elements of preceding
array
,
if
array
is a numeric array. If a comma follows
array
,
each element is printed at the beginning of a
20-character field. If a semicolon follows
array
,
elements are separated by two spaces. Each string array
element is printed on a separate line.
END Statement prints EOF after last element of last
array
.
File must be ASCII or binary.
The following statements can also print arrays:
DISP, PRINT
DISP USING, PRINT USING
If array A has four elements, the following statements are equivalent:
100 MAT PRINT A
100 PRINT A(*)
100 PRINT A(1),A(2),A(3),A(4)
100 PRINT (FOR I=1 TO 4, A(I))