EasyManua.ls Logo

Commodore CBM - Page 30

Commodore CBM
447 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...
Special Symbols
Special symbols, or special characters, have
two
general uses:
1.
They may represent standard punctuation marks
or
commonly used
symbols.
For example, there
is
a period, a comma,
arithmetic
opera-
tions
(+
for addition. - for subtraction. etc.). and other characters
that
have
widely
recognized interpretations, such
as
"$"
for dollar sign.
2.
These same characters may at other times represent a specifie opera-
tion
or
be part of a BASIC statement. Remember,
we
use the
word
"syntax"
to
describe the special rules governing the characters
that
must
appear in a BASIC statement and the order in
which
they
must
ap-
pear.
Thus, the same symbol means different things when used
in
different
contexts.
Some English words. called homonyms, also have this property. For ex-
ample. pool can
be
a pool of
water
or a game of pool.
Consider the
following
PET
BASIC statement:
IF
A=l
THEN
B=2
This BASIC statement uses the equal sign (=) twice, apparently
with
the
same meaning in each case.
But
these
two
equal signs actually mean different
things to
PET
BASIC. The first equal sign. in the phrase
IF
A=l.
has
a standard
meaning of equality;
PET
BASIC must determine
whether
A
has
the current value
of
1.
In the second phrase. THEN
B=2,
however, the equal sign in interpreted
as
"assign B the value of
2.
regardless of
what
its current value is." These equal
signs are called
"program
operators." A program operator
is
a special symbol
that
tells
PET
BASIC to perform a certain operation.
Note
that
"A"
and
"B"
have been used
as
varĀ·iables; each
is
a
"name"
assigned
to
a ''1etter box." The BASIC statement above checks
to
see
if letter box
"A"
contains 1; if it does, 2 gets
put
into letter box
"B".
17

Table of Contents

Other manuals for Commodore CBM

Related product manuals