EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 267

Radio Shack TRS-80 Model 4
418 pages
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...
\ spaces \
PRINT
USING
Statement
PRINT USING format; data item,
...
Prints data items using a format specified
by
you.
Format consists of one or more field specifiers enclosed
in
quotes, or
a string variable which contains the field specifier(s).
Data item may be string and/or numeric value(s).
This statement
is
especially useful for printing report headings,
accounting reports, checks, or any other documents which require a
specific format.
With PRINT USING, you may use certain characters (field specifiers)
to format the field. These field specifiers are described below. They
are followed
by
sample program lines and their output to the screen.
Specifiers
for
String
Fields:
Print the first character
in
the string only.
PRINT USING
"!"; "PERSONNEL"
P
Print 2+ n characters from the string.
If
you type the
backslashes without any spaces, BASIC prints two
characters; with one space, BASIC prints three
characters,
and
so
on.
If the string is longer than the
field, the extra characters are ignored.
If
the field is
longer than the string, the string
is
left-justified and
padded with spaces
on
the right. To enter a
backslash, press
(CLEARl(1J.
PRINT USING
"\bbb\";
"PERSONNEL"
(three spaces between the backslashes)
PERSO
&
Print the string without modifications.
10
A$="TAKE":B$="RACE"
20 PRINT USING "!";A$;
30
PRINT USING "&";B$
RUN
TRACE
2-141

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals