``

prev Menu next

MAT PRINT ☆☆
A MAT PRINT statement outputs all element of arrays.
When A is a 1-dimensional array,
`MAT PRINT A`
is practically equivalent to

    30 FOR I=LBOUND(A) TO UBOUND(A)
    40      PRINT A(I),
    50 NEXT I
    60 PRINT

Provided that MAT PRINT first outputs a new line if the line on which the output starts is not empty.
When A is a 2-dimensional array,
`MAT PRINT A`
is practically equivalent to

    20 FOR I=LBOUND(A,1) TO UBOUND(A,1)
    30   FOR J=LBOUND(A,2) TO UBOUND(A,2)
    40      PRINT A(I,J),
    50   NEXT J
    60   PRINT
    70 NEXT I

When A is a 3-dimensional array,
`MAT PRINT A`
is practically equivalent to

    10 FOR I=LBOUND(A,1) TO UBOUND(A,1)
    20   FOR J=LBOUND(A,2) TO UBOUND(A,2)
    30      FOR K=LBOUND(A,3) TO UBOUND(A,3)
    40         PRINT A(I,J,K),
    50      NEXT K
    60      PRINT
    70   NEXT J
    80   PRINT
    90 NEXT I

When a semicolon is written succeeding the array as follows, it is practically equivalent to what generated by replacing the comma in line 40 to a semicolon on the above.
`MAT PRINT A;`
two or more arrays can be written separated by commas or semicolons as
`MAT PRINT A;B,C`