Integers
An integer
is
a number that has
no
fractional portion
or
decimal point.
The number can
be
signed negative
(-)
or positive (+).
An
unsigned number
is
assumed ta
be
positive. Integer numbers have a limited range of values. from
-32767
ta
+32767.
The
following
are examples of integers:
o
1
44
32699
-15
Any
number that
is
an
integer can also
be
represented in floating
point
for-
mat. since integers are a subset of floating point numbers. PET BASIC converts
any integers
to
floating point representation before doing arithmetic
with
them. The most important difference
between
f10ating point numbers and in-
tegers
is
that an integer array uses less storage space
in
memory (two bytes
for
an
integer. versus five bytes for a floating
point
numberl.
STRINGS
We
have already used strings
as
messages
ta
be
printed on the display
screen. A string consists of one
or
more characters enclosed
in
double quota-
tion marks. Here are some examples of strings:
"HI!"
"SYNERGY"
"12345"
"$10.44
IS
THE
AMOUNT"
"22
UNION SQUARE. SAN FRANCISCO
CA"
Ail of the data keys (alphabetic. numeric. special symbols. and graphies).
as
weil
as
the three cursor control keys (Clear Screen/Home. Cursor
Up/Down.
Cur-
sor
Lett/Rightl and the Reverse On/Off key can
be
included in a string. The only
keys
that
cannot
be
used
within
a string (besides the
SHIFT
key)
are Run/Stop.
RETURN.
and Insert/Delete.
Ali characters
within
the string are displayed
as
they appear. The cursor
control and Reverse
On/Off
keys. however. normally do
not
print
anything them-
selves; to show
that
they are present in a string. certain reverse field symbols are
used. They are shown
in
Table 3-1.
When
vou enter a string from the keyboard.
it
can have any length up
ta
the
space available
within
an
80-character line (that
is.
any character spa
ces
not
taken up by the line number and other required parts of the statement). However.
strings of up to
255
characters can be stored
in
the PET's memory. Vou
get
long strings by pushing together,
or
concatenating,
two
separate strings to
form one longer string.
We
will
describe this further when
we
discuss string
variables
in
general.
57