User`s manual

6-2
Let's set up an array, CK, to correspond to the checkbook information table.
Since the table contains 6 rows and 3 columns, array CK will need two
dimensions: one for row numbers, and one for column numbers. We can
picture the array like this:
A(1,1)=025
.
.
.
.
A(6,1)=030
A(1,2)=1.0178
.
.
.
.
A(6,2)=1.1578
A(1,3)=10.00
.
.
.
.
A(6,3)=12.49
Notice that the date information is recorded in the form
mm.ddyy.
where
mm=month number,
dd=day of
month, and yy = last two digits of year.
Since
CK is a numeric array, we can't store the data with alpha-numeric
characters such as dashes.
Suppose we assign the appropriate values to the array elements. Unless we
have used a DIM statement, the Computer will assume that our array
requires a depth of 10 for each dimension. That is, the Computer will set
aside memory locations to hold CK(7,1), CK(7,2), …, CK(9,1), CK(9,2) and
CK(9,3). In this case, we don't want to set aside this much space, so we use
the DIM statement at the beginning of our program:
10
DIM CK(6,3) 'SETUP A 6 BY 3 ARRAY (EXCL. ZERO SUBSCRIPTS)
Now let's add program steps to read the values into the array CK:
20 FOR ROW=1 TO 6
30 FOR COL=1 TO 3
40 READ CK(ROW,COL)
50 NEXT COL,ROW
90 DATA 025, 1.0178, 10.00
91 DATA 026, 1.0578, 39.95
92 DATA 027, 1.0778, 23.50
93 DATA 028, 1.0778, 149.50
94 DATA 029, 1.1078, 4.90
95 DATA 030, 1.1578, 12.49