EasyManua.ls Logo

Radio Shack TRS-80 Model III - Program Statements

Radio Shack TRS-80 Model III
274 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...
+
When
a
+ sign
is placed at the
beginning or
end of the field
,
it
will
be
printed as
specified as a
+ for
positive numbers or as
a
for
negative
numbers.
-
When a
-
sign is placed at the
end
of the field, it
will
cause a
negative
sign to appear
after all negative
numbers and will
appear as
a
space
for positive
numbers.
% spaces
% To specify a
string
field of more
than one
character,
% spaces
% is used.
The length of the
string field will be 2
plus the
number of
spaces between the
percent signs
.
!
Causes the
Computer to use
the first
string character of the current
value.
Any other
character
that
you include
in the USING
string will be
displayed as a string
literal.
The
following
program will help
demonstrate these
format
specifiers:
IB INPUT
"TYPE
IN
FORMAT, THEN DATA";
A*? A
20
PRINT USING A*;
A
30 GOTO 10
RUN this
program and try
various
specifiers and strings
for A$ and
various values
for A.
For Example:
> RUN
TYPE IN
FORMAT? THEN
DATA? ##.#?
12.12
12. 1
TYPE
IN
FORMAT? THEN
DATA? ##.#» 1.34
1.3
TYPE IN
FORMAT? THEN
DATA? ###.##? 1000.33
7.1 000. 733
TYPE IN
FORMAT? THEN
DATA?
The %
sign is
automatically printed
if
the
field is not
large enough to
contain the
number of digits
found in the numeric
value. The
entire number to the
left of the
decimal
will
be
displayed
preceded by
this sign.
> RUN
TYPE
IN
FORMAT?
THEN
DATA?
##.##?
12.127
12.1
3
TYPE
IN
FORMAT?
THEN
DATA?
Note that the
number was rounded
to
two
decimal places.
137

Other manuals for Radio Shack TRS-80 Model III

Related product manuals