Special symbols can also be used as data characters, just Iike letters of
the alphabet.
Consider the
following
examples:
Statement
1:
PRINT
"HI
FRED,
MARY. AND
AL"
Statement 2: PRINT
FR,
MA,
AL
ln the first statement. the commas are ordinary punctuation marks; they are
data characters
just
like ail the letters (and spaces) inside the quotation marks. In
facto
every character occurring between the
quotation
marks
is
a simple
text
character,
which
the BASIC interpreter treats
as
a
text
string.
just
as
a
typewriter
wou
Id
treat a keystroke. 1n statement
2,
however, the commas are program opera-
tors; they are telling
PET
BASIC
to
use a special form of tabular alignment
when
printing
out
values assigned
to
variables
FR,
MA.
and AL.
Table 2-1 summarizes the meanings of the special symbols when they
are used as program
opera
tors.
These usages are described in detail in Chapter
3.
Some of the special symbols do
not
have a program operator function. Such
symbols are merely graphie characters: they are used
to
create pictures on the
display screen. Some program operators are formed by combining special sym-
bols
and/or
letters of the alphabet
just
as
vou combine letters into words.
We
will
describe these program operators later.
Special symbols and letters of the alphabet can have different meanings. de-
pending on where they appear in a BASIC statement. The
word
PRINT.
for exam-
pie.
is
the part of a BASIC statement that tells the
PET
to
print something. If the
same
word
were enclosed in quotes.
it
would
be
interpreted
as
a
word
of text.
Consider the
aHirst
confusing statement:
PRINT
"PRINT"
The first PRINT
is
a command
to
print.
but
the second PRINT
is
a
word
of
text. or a string, because
it
is
enclosed
in
quotes.
What
would
this statement do?
You have probably already guessed - it
would
print
the
word
PRINT.
(The
shaded portions
in
the screen examples show
what
you
type in; the
unshaded portion
is
the PET's response):
PET
BASIC doesn't
just
have homonyms - the same
word
having different
meanings:
it
also
has
synonyms - different words
that
have the same meaning.
For example, the command
PRINT
can
be
abbreviated to a question mark.
18