Fixed Variables - Sharp PC-1403 Operation Manual

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

Advertisement

79
This means that you
have
put
numeric data into the
area
of memory called A and then
told the
computer
to show you
that
information
again as STRING
data.
Thi
s confuses
the computer so
it says that there
is
an
error
condition.
Press
the
~
key to
clear the
error
condition.
Now
try
the following
example:
A$
=
"ABC"
I
ENTER
I
A
I
ENTER
I
ERROR 9
Fixed
Variables
The first
section,
fixed
variables,
is
always used by
the computer for storing data. It can
be thought of as pre-allocated
variable
space. In other
words,
no matter how much
memory your program uses
up, you
will
always
have at least 26 variables to choose
from to store data
in. This
data
can be one of two
types:
NUMERIC or STRING
(alphabetic character). Fixed
memory locations are eight bytes
long and can be used
for only one type
of
data
at
a
time.
To
illustrate this, type in
the following
examples:
A= 123
[ENTER)
A$
[ENTER)
You
get
the
message:
Numeric
variables
Fixed
numeric
variables (A
to Z)
Simple
numeric variables (AB, C1, etc.)
Numeric array
variables
Fixed
character
variables (A$
to
Z$)
Simple
character
variables (BB$,
C2$, etc.)
Character
array
variables
String
variables
Variables
S
II
II
To
illustrate this, key in
B
lsH1FTI
[l[]
=
lsH1FTI
rwi
BYTE
[sH1nl
I
Wl
I
ENTER].
The value BYTE is
now
stored in the variable 8$.
To
make
sure
of this, type
in
B I
SHIFT
I
d:J
I
ENTER).
The screen shows
BYTE. This
time
the
display is
on the left side
of
the
screen,
instead
of the
right.
Variables
handled by the
SHARP COMPUTER
are divided i
n
to the following;
So far,
we've
only
discussed
numeric
variables.
What
about
storing
alphabetic
characters?
Well,
the
idea is the
same,
but,
so the
computer
will know the difference
between
the two
kinds of
variables,
add
a$
to the variable
name.
For instance,
let's
store the word
BYTE
in
the
variable
8$.
Notice
the$
after the
B?
This
tells the computer
that the
contents
of
the
letter
B
are alphabetic,
or
string
data.
Concepts
and Terms of BASIC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents