Commodore PET User Manual page 83

Table of Contents

Advertisement

where:
name
A single-dimensional array element has the form:
name(j)
where:
name
is the variable name of the array. The na me may be any type
of variable name.
is the array index to that element. On the PET the index i must
start at O.
A single-dimensional array called
A.
having five elements. would be stored
as follows:
A(O)
1-----1
A(l)
1-----1
A(2)
1-------1
A(3)
r - - - - - i
A(4)
L..-_ _.......
The number of elements in the array is equal to the highest element number.
plus 1 to count array element O.
A two-dimensional array element has the form:
name(i,j)
is the variable name of the array. It may be any type of varia-
ble name.
is the column index.
J
is the row index.
A two-dimensional array called A$. having three column elements and two
row elements. would appear as follows:
A$(O.O)
A$(O.l)
I - - - - - f - - - - i
A$(1.0)
A$(1.1)
A$(2,O)
A$(2, 1)
The size of the array is the product of the highest row element plus 1,
multiplied by the highest column element plus 1. For this array, it is 3x2=6 ele-
ments.
Additional dimensions can be added to the array:
name (i,j,k,...)
70

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents