EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 269

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...
$$
**$
Print a dollar sign immediately before the number.
This specifies two more digit positions, one of which
is
the dollar sign.
PRINT USING
"$$##.##";
112.7890
$112.79
Fill
leading spaces with asterisks
and
print a dollar
sign immediately before the number.
PRINT USING
"**$##.##";
8.333
***$8.33
Print a comma before every third digit
to
the left
of
the decimal point. The comma establishes another
digit position.
PRINT USING
"####,.##";
1234.5
1,234.50
Print
in
exponential format. The four exponent signs
are
placed after the digit position characters. To type
the
~,
press (CLEAR)Q.
You
may specify any
decimal point position.
PRINT USING
".####
~
~ ~
~";
888888
.8889E+06
Print next character
as
a literal character.
PRINT USING
"_!##.##_!";12.34
!12.34!
Sample Program
420
CLS:
A$
=
"**$##1######,##
DOLLARS"
430
INPUT
"WHAT
IS
YOUR
FIRST
NAME"
;
F$
440
INPUT
"WHAT
IS
YOUR
MIDDLE
NAME"
;
M$
450
INPUT
"WHAT
IS
YOUR
LAST
NAME";
L$
460
INPUT
"ENTER
AMOUNT
PAYABLE"
; P
470
CLS
:
PRINT
"PAY
TO
THE
ORDER
OF
" .
l
480
PRINT
USING
II
I I
I I " .
F$;
II II
d
M$;
"
" .
l
, I
,
l
490
PRINT
L$
500
PRINT :PRINT
USING
A$;
P
In
line 480,
each!
picks
up
the first character of one of the following
t
.
(F$""
M$
d " "
.)
N t'
th
t .
"II~II~"
S nngs
,.,
,
an
. again. 0
Ice
e
wo
spaces
In
..IU
..
IU.
These two spaces insert the appropriate spaces after the initials of
the name (see below). Also notice the use of the variables A$ for
format
and
P for item list
in
line 500. Any serious use
of
the PRINT
USING statement would probably require the use of variables
at
least
for item list rather than constants. (We've used constants
in
our
examples for the sake of better illustration).
2-143

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals