Commodore 64 User Manual page 111

Hide thumbs Also See for 64:
Table of Contents

Advertisement

A(3,4) = 255
COLUMN
0
1
ROW
2
3
4
5
6
255
If we assigned the value 255 to A(3,4), then 255 could be thought of
as being placed in the 4th column of the 3rd row within the table.
Two-dimensional arrays behave according to the same rules that were
established for one-dimensional arrays:
They must be dimensioned:
DIM A(20,20)
Assignment of data:
A(l,1) = 255
Assign values to other variables:
AB = A(1,1)
PRINT values:
PRINT A(l,l)
If two-dimensional arrays work like their smaller counterparts, what
additional capabilities will the expanded arrays handle?
Try this: can you think of a way using a two-dimensional array to
tabulate the results of a questionnaire for your club that involved four
questions and had up to three responses for each question? The prob-
lem could be represented like this:
CLUB QUESTIONNAIRE
Ql: ARE YOU IN FAVOR OF RESOLUTION #1?
1-YES
2-NO
3-UNDECIDED
. . . and so on.
101

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents