Variables N The Form Of A ( ) - Sharp PC-1403 Operation Manual

Hide thumbs Also See for PC-1403:
Table of Contents

Advertisement

84
10 DIM
8(2)
20
A(28)=5
30
BC-=12
40 A(30)=9
There
are
26 fixed
variable
names availabl
e
, i.e.,
A through
Z
(A$
through Z$).
Each
of these
names
can
be subscripted
with
numbers
1
through
26,
such
as
A(1)
-
A(26)
or A$(1) -
A$(26).
This
means
that
variable
A(1)
may
be used
in
place
of variable
A,
A(2)
in
place
of
B,
A(3)
in
place
of
C,
and
so
forth.
However,
if
an
array named
A or
A$ has already
been defined
by the
DIM
statement,
subscripted
variables
named
A cannot
be
defined.
For
example,
if
array
A
is
defined
by
DIM
A(5),
the
locations
for
A(O)
through
A(5)
are set
aside
in the program/data
area. So if
you
specify
variable
A(2),
it
does not
refer
to
fixed
variable B,
but
refers
to
the
array variable A(2) defined in the
program/data
area.
If
you
specify
A(9),
it
will
cause an error
since
A(9)
is
outside
the range
of
the dimension specified
by
the
DIM
A(5) statement.
In
turn,
if subscripted
variables
are
already
defined
in
the
form
of A( ),
it is
not
possible
to
define array
A or
A$
by using
the
DIM
statement,
unless
the definition
for
the
subscripted
variables
is cleared with
the
CLEAR statement.
"
Using
subscripts in excess
of
26:
If
subscripts
greater
than
26 are
used
for subscripted
variables
A(
)
when array
A
is
not
defined by
a
DIM
statement, the
corresponding
locations
in the
program/data
area
are
set
aside for these
A(
)
variables.
For
instance,
if you execute A(35)
=
5,
l
o cations
for variables
A(27)
to
A(35)
will be reserved
in
the
program/data
area.
While
variables
subscripted in
excess
of
26 are
treated
as
array
variables,
they are
subject to
the
following
special
restrictions:
(1)
Locations for
an
array
with the same name
must
be
contiguous
in
the
program/
data
area.
Otherwise,
an
error
will
occur.
Variables In the
Form
ot
A( )
Whereas
a
data area
on
the
computer's
memory
is
set aside
for fixed
variables, it
may
also be used to define subscripted
variables
which
have the same
form
as
array
variables.
Element
Line number
Statement
&
function
Others,
I
ENTER)
Number of
bytes
used
3 bytes
1 byte
or
2 bytes
1
byte
Concepts
and Terms of BASIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents