PrinterIScreen Concatenation
Another method
is
available if vou
want
the strings concatenated for screen
or printer
output
only. and
not
retained in the
PET
memory. This
is
done
with
the
PRINT statement
and
semieolon separa
tors
(;) between the strings:
F'RINT
A$.;
~T$.;
S$
F~U~·j
ABCDEFGHIJKLMNOPQRSTUVWXYZ
The above result
(A
through
l)
is
equivalent to the contents of
l$
because the
semicolons allow no embedded blanks between the strings. The only difference
is
that
the screen result
(A
through
l)
is
not
retained anywhere in
PET
memory.
However. this method
will
not
concatenate strings
without
embedded blanks if
the strings were previously converted from a numeric variable
with
the STR$ or
VAL
functions; this
will
be
discussed further in the
"Numeric
Strings" section.
Concatenating Graphie Strings
Concatenating graphie strings can be very useful in creating pictures and
diagrams.
Graphie strings are eoneatenated
in
the same
way
as
alphabetie
strings.
NUMERIC STRINGS
A numeric string
is
a string composed of numbers - or a combination of
numbers and decimal point. negative sign. or exponent -
that
evaluates to a real
number. A numeric string must
be
identified by a
"$"
following
the string
na
me.
The contents of numeric strings may
be
assigned in
two
different ways.
each yielding slightly different results.
When numerie variables are assigned to
numerie strings using the STR$ funetion, the sign value preeeding the num-
ber (blank if positive,
"-"
if negative)
is
transferred along
with
the number.
This
is
shown in the short program below:
1121
AB=12345
2(1
T$=STR$(AB)
::::13
F'RINT"AB=".;
AB
413
F'RINT"T$=".;
T$
AE:=
12345
T$=
12345
182