EasyManua.ls Logo

Apple IIe - Page 53

Apple IIe
320 pages
Print Icon
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...
Applesoft
BASIC
Programming
53
numeric.
However
, some
programs
require
that
hundreds
or
even thousands
of
variable names be used.
Obviously,
the
use
of
thousands
of
individual
variable names
could
prove
extremely
cumbersome.
To
overcome
this
problem
,
BASIC allows
the
use
of
subscripted variables. Subscripted
variables are
identified
with
a subscript, a
number
appearing
within
parentheses
immediately
after
the
variable name.
An
example
of
a
group
of
subscripted variables
is
given
below
:
A(O),
A(1), A(2), A(3), A(4),
..
. , A(100)
Note
that
each
subscripted
variable
is
a
unique
variable.
In
other
words
,
A(O)
differs
from
A(1), A(2), A(3), A(4), etc.
Subscripted variables
should
be visualized
as
an
array
(or
table).
In
our
previous
example
,
the
data
contained
in
the
array
defined
by A
would
consist
of
one
row
with
101
columns
in
it. Such
an
array
is
a
single-dimension
array.
In
Applesoft
BASIC, arrays
of
up
to
eleven*elements
can
be
used
as
needed
in
a
program.
Arrays
which
contain
more
than
eleven
elements must first be
identified
via
the
Dimension
(DIM)
statement.
When
an array
is
dimensioned
, BASIC
will
reserve an
area
in
memory
for
that
array's
elements
.
The
following
Dimension
statement
will
dimension
a
numeric
array
of
16
elements.
100
DIM
B(15)
More
than
one
array can be
defined
with
a single
DIM
statement. This
is
shown
in
the
example
below
:
100
DIM
Z(S
,2), B(100), C(2,3)
*An
array
of
eleven
elements
would
contain
the
subscripts 0
through
10 inclusive. For
example
, an array
dimensioned
as
A(10)
would
have eleven elements
A(O)
through
A(10) inclusive.

Other manuals for Apple IIe

Related product manuals