EasyManua.ls Logo

Atari 400

Atari 400
122 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DIM
(DI.)
8
ARRAYS
AND
MATRICES
An
array
is
a
one-dimensional
list
of
numb
ers
assigned
to
subscripted
va
riables
;
e.g.,
A(O),
A(1), A(2).
Subscripts
range
from
0
to
the
dimensioned
value.
Figure
8-1
illustrates
a
7-element
arra
y.
A(O)
A(1)
A(2)
A(3)
A(4)
A(S)
A(6)
Figure
8-1.
Example
of
an
Array
A
matrix,
in
this
context,
is
a
two-dimensional
table
co
ntaining
rows
and
col-
umns.
Rows
run
horizontally
and
columns
run
v
erticall
y.
Matrix
elements
are
stored
by
BASIC
in
row
-m
a
jor
order.
This
means
that
a
ll
the
e
lem
ents
of
the
first
row
are
stored
first,
followed
by
all
the
elements
of
the
second
row,
etc
.
Figure
8-2
illustrates
a 7 x 4
matrix.
Columns
M(O,O)
M(0,1) M(0,2)
M(0,3)
M(1,0)
M(1
,1)
M(1,2)
M(1,3)
M(2,
0)
M(2,1)
M(2,2)
M(2,3)
M(3,
0)
M(3,1)
M(3,2)
M(3,3)
M(4,0) M(4,1) M(4,2) M(4,3)
M(5,
0)
M(5,1) M(5,2) M(5,3)
M(6,0) M(6,1) M(6,2)
M(6,3)
Figure
8-2.
Example
of
a
Matrix
This
section
describes
the
two
commands
associated
with
arrays,
matrices,
and
strings,
a
nd
how
to
load
both
arrays
and
matrices.
The
com~a
nds
in
this
se
c-
tion
are:
DIM
CLR
Format:
D M {
svar(aexp)
}
1
mvar(aexp[
,aexp])
IJ{
,svar(aexp)
}tl
~
,mvar(aexp[
,aexp
... ] U
Examples:
DIM A(100)
DIM M(6,3)
DIM B$(20)
used
w
ith
STRINGS
An
a
,v
s
and
Matr·ices
41

Table of Contents

Other manuals for Atari 400

Related product manuals