Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

BASIC+ automatically allocates space for a 0 (zero) element when a matrix is dimensioned. That is, one more element is always available to receive data than is dimensioned in the Dimension statement. It is a single element, not a row or column. The data in the 0 (zero) element can be accessed by using a 0 (zero) subscript:

Matrix(0)

See also

CommonMat

Remarks

Code Block
/* Two matrices are dimensioned. MONTH has 13 elements including a 0 (zero) element. 
YEAR has 61 elements (12 rows by 5 columns, plus a 0 (zero) element). */
Dim MONTH(12), YEAR(12, 5)
 
/* The number of rows in matrix TESTB is the current value of X and the number of columns is the current value of Y. */
Dim TESTB(X, Y)
/* Matrices named V, K, and R; each to contain 11 elements. 
The additional element in each is the 0 (zero) element. */
Dim V(10), K(10), R(10)