EasyManua.ls Logo

Commodore Plus 4 - Page 22

Commodore Plus 4
464 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...
10
The
BASIC
Language
either
both
0
or
both
1,
the
result
of
the
comparison
is
0.
When
the
two
XORed
bits
are
not
equal,
the
result
of
the
comparison
is
1.
Comparing
Text
Strings
You
can
use
the
standard
comparison
operators
to
compare
text
strings.
Strings
are
compared
character
by
character;
blanks
are
considered
to
be
significant
characters.
So,
for
example,
"WORD"
does
not
equal
"WORD
".
Each
charac
ter
is
evaluated
according
to
its
PET/CBM
character
set
(CHR$)
number
(see
Appendix
C).
This
character
set
gives
a
number
value
to
every
possible
character.
"A"
(65)
is
less
than
"B"
(66)
is
less
than
"C"
(67),
and
so
forth.
A
blank
has a
value
of
32,
so
it
is
less
than
any
letter,
but
significant
nonetheless.
"WORD"
is
less
than
"WORD
"
because
the
blank
in
"WORD
"
gives
that
string
a
greater
value.
Consider
the
expression
A$=B$.
If
all
characters
in
all
character
positions
in
the
two
strings
are
equal,
a
truth
result
(-1)
is
returned.
False
comparisons
produce
a 0
result.
The
result
of
a
string
comparison
is
always
an
integer
value
(0
or
-1),
so
you
can
use
the
result
in
a
mathematical
calculation.
Note,
however,
that
you
cannot
use a
false
result
as
a
divisor
because
division
by
zero
is
illegal.
BASIC
Abbreviations
Most
BASIC
keywords
can
be
abbreviated.
These
time-saving
abbreviations
are
shown
in
Table
1-4.
You
can
use
abbreviations
to
"cheat"
on
the
88-character-
per-command
line
limitation.
But
when
a
line
containing
abbreviations
is
LISTed,
the
abbreviations
are
converted
into
spelled-out
keywords.
You
cannot
edit
and
reenter
such
a
line
using
the
screen
editor
if
it
is
more
than
88
characters
when
LISTed.
Only
the
first
88
characters
will
be
accepted.
Retype
the
line
with
the
abbreviations
instead.
The
table
shows
some
characters
in
uppercase
and
others
in
lowercase.
You
will
no
doubt
usually
enter
programs
in
uppercase/
graphic
mode,
so
abbrevia
tions
will
not
appear
in
upper-
and
lowercase.
Instead,
the
uppercase
letters,
which
must
be
typed
with
the
SHIFT
key,
appear
as
graphic
symbols.
We
use
uppercase
and
lowercase
letters
instead
of
uppercase
and
graphic
symbols
to
make
the
table
easier
to
read.
Just
remember
to
press
SHIFT
when
you
type
the
letters
shown
here
in
uppercase.
Crimcliiiig
Programs
When
you
want
a
program
to
use
less
memory,
there
are
several
crunching
tricks
you
can
use;
they
can
be
found
on
page
12.

Other manuals for Commodore Plus 4

Related product manuals