BASIC
Multiple strings or string variables
can be joined together (concatenated)
by these
specifiers. The
"
!
"
sign will
allow only the first letter of each string
to be printed.
For example:
10 INPUT "TYPE.-
IN THREE
NAMES" 5 A*»
B*» C*
20 PRINT USING
"!";
A*» B$»
C$
30
GOTO 10
And RUN it.
. .
> RUN
TYPE IN
THREE NAMES?
ABC,
DEF»
GHI
ADG
TYPE
IN
THREE
NAMES?
By
using more than one
"
!
" sign, the first
letter of each
string will be
printed with
spaces
inserted corresponding to
the spaces
inserted between
the
"
!
"
signs. To
illustrate this
feature, make the
following
change to the last
little program:
20 PRINT
USING
"!
I
!"5
A*»
B*»
C*
And RUN it. . .
>RUN
TYPE
IN
THREE
NAMES?
ABC?
DEF*
GHI
ADG
TYPE
IN
THREE
NAMES?
Spaces
now appear between letters A, D and Gto
correspond
with those placed
between the
three
"!"
signs
.
Try changing
"
! !
!"
to
"%%"
in line
20
and run the
program.
The following program demonstrates
one possible use
for the PRINT USING
statement.
510
CLS
520 A*
=
"#*$##,######„##
DOLLARS"
530 INPUT "WHAT
IS YOUR FIRST
NAME"; F*
540 INPUT
"WHAT
IS
YOUR
MIDDLE NAME"
5
M*
550 INPUT
"WHAT IS
YOUR
LAST NAME"
5
L*
560
INPUT
"ENTER THE
AMOUNT
PAYABLE"; P
570
PRINT:
PRINT
"PAY
TO THE
ORDER OF
"5
580 PRINT
USING "I.
I. 7.
"/."
?
F**
M** L*
600
PRINT:
PRINT
USING A*?
P
620
END
139