Tandy 1000 Basic Reference Manual page 274

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I
BASIC
Keywords
PRINT USING
Statement
PRINT USING format; data[,data,
...
I
Prints data using a format you specified. This statement is espe-
cially useful for printing report headings, accounting reports,
checks, or any other documents that require a specific format.
Format
consists of 1 or more field specifierb), or any alphanu-
meric character.
Format
must be enclosed in quotation marks.
Data
may be string and/or numeric value(s1. If you specify more
than 1 data item in the statement, use the same separators as
described in PRINT.
With PRINT USING, you may use certain characters called field
specifiers, to format the field. You may use more than 1 field spe-
cifier, except as indicated.
Specifiers for String Fields:
!
prints the first character in the string only
P R I N T U S I N G
' I ! " ;
"PERSONNEL"
BASIC prints P.
\spaces
\
prints 2
+
n characters from the string (n is the num-
ber of spaces between the slashes). If you type the
backslashes without any spaces, BASIC prints 2 char-
acters; with one space, BASIC prints 3 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.
P R I N T U S I N G " \ B B B \ " ;
"PERSONNEL"
BASIC prints PERSO
prints the string without modifications.
1 0
A $ = " T A K E " : B $ = " R A C E "
2 0 P R I N T U S I N G " ! " ; A $ ;
3 0 P R I N T U S I N G
"&";E$
When this program is run, BASIC prints TRACE.
&
272

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents