User`s manual

6-3
Now that our array is set up, we can begin taking advantage of its built-in
structure. For example, suppose we want to add up all the checks written.
Add the following lines to the program:
100 FOR ROW=1 TO 6
110 SUM=SUM+CK(ROW,3)
120 NEXT
130 PRINT"TOTAL OF CHECKS WRITTEN";
140 PRINT USING"$$###.##";SUM
Now let's add program steps to print out all checks that were written on a
given day.
200 PRINT "SEEKING CHECKS WRITTEN ON WHAT DATE (MM.DDYY)";
210 INPUT DT
230 PRINT :PRINT"ANY CHECKS WRITTEN ARE LISTED BELOW:"
240 PRINT"CHECK #","AMOUNT" : PRINT
250 FOR ROW=1 TO 6
260 IF CK(ROW,2)=DT PRINT CK(ROW,1),CK(ROW,3)
270 NEXT
It's easy to generalize our program to handle checkbook information for all 12
months and for years other than 1978.
All we do is increase the size (or "depth") of each dimension as needed. Let's
assume our checkbook includes check numbers 001 through 300, and we
want to store the entire checkbook record. Just make these changes:
10 DIM CK(300,3) 'SET UP A 300 BY 3 ARRAY
20 FOR ROW=1 TO 300
and add DATA lines for check numbers 001 through 300. You'd probably
want to pack more data onto each DATA line than we did in the above DATA
lines.
And you'd change all the ROW counter final values:
100 FOR ROW=1 TO 300
.
.
250 FOR ROW=1 TO 300