Simple Variables - Sharp PC-1403 Operation Manual

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

Advertisement

80
Simple Variables
Simple variable
names are
specified
by two or more al
p
hanumeric
characters,
such as
AA or
81.
Unlike
fixed
variables,
simple variables have no dedicated storage area
in
the
memory.
The area for simple variables
is
automatically
set aside (within
the
program and
data area)
when a simple
variable is first
used.
Since
separate memory
areas are
defined
for simple
numeric
variables
and simple
character
variables
even
if they have the
same
name, variables
such
as
AB and
AB$,
for
example, may
be used
at the same
time.
Whereas
alphanumeric
characters are usable
for simple
variable names, the first
character
of a variable name must
always
be alphabetic and
uppercase.
If
more
than
two characters
are
used to define a
variable
name, only the first two characters are
meaningful.
A
=A$
=
A(1)
=
A$(1)
B
=
8$ =
A(2)
·
=
A${2)
c
=
C$
=
A(3)
=
A$(3)
D
=
0$
=
A(4)
=
A$(4)
E =
E$
=
A(5)
=
A$(5)
F
=
F$
=
A{6)
=
A$(6)
G
=
G$
=
A(7)
=
A$(7)
H
=
H$
=
A(8)
=
A$(8)
=
1$
=
A(9)
=
A$(9)
J
=
J$
=
A(10)
=
A$(10)
K
=
K$
=
A(11)
=
A$(11)
L
=
L$
=
A(12)
=
A$(12)
M
=
M$
=
A(13)
=
A$(13)
N
=
N$
=
A(14)
=
A$(14)
0
=
0$
=
A(15)"
=
A$(15)
p
P$
=
A(16)
=
A$(16)
Q
=
0$
=
A(17)
=
A$(17}
R
=
R$
=
A(18)
=
A$(18)
s =
S$
=
A(19)
=
A$(19)
T
=
T$
=
A(20)
=
A$(20)
u
=
U$
=
A(21)
=
A$(21)
V
=
V$
=
A(22)
=
A$(22)
W
=
W$
=
A(23)
=
A$(23}
x
=
X$
=
A(24)
=
A$(24)
y
=
Y$
=
A(25)
=
A$(25)
Z
=
Z$
=
A(26)
=
A$(26)
Concepts and Terms of BASIC
Again, the
computer is
confused
and
gives the
ERROR
9
message.
Look
at the figure
shown below
to
see that
the
variable
name
A
equals the same area
in memory
as
the
variabl
e name
A$,
and that B equals
8$,
and so on
for
all
the letters
of
the alphabet'.
Figure:

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents