EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 266

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...
are printed
in
ordinary format. For example, 1E-7
is
printed
as
.0000001; 1E-8
is
printed
as
1E-08.
Double-precision numbers with 16 or fewer digits that can be
accurately represented
in
ordinary format, are printed using the
ordinary format. For example, 10-15 is printed
as
.000000000000001;
10-16
is printed
as
10-16.
BASIC prints positive numbers with a leading blank.
It
prints
all
numbers with a trailing blank.
To insert strings into this statement, surround them with quotation
marks.
Examples
PRINT
"DO"
i
"NOT"
i
"LEAl.JE"
i "SPACES";
"BETWEEN"
i "THESE" i
"WORDS"
prints
on
the display:
DONOTLEAVESPACESBETWEENTHESEWORDS
Sample Program
80
INPUT
"ENTER
THIS
YEAR"
i Y
70
INPUT
"ENTER
YOUR
AGE"iA
80
INPUT
"ENTER
A
YEAR
IN
THE
FUTURE"iF
80 N = A +
IF
- Yl
100
PRINT
"IN
THE
YEAR"F"YOU
WILL
BE"N"YEARS
OLD"
RUN
Since F and N are positive numbers, PRINT inserts a space before
and after them, therefore your display should look similar to this
(depending
on
your input):
IN
THE
YEAR
2004
YOU
WILL
BE
48
YEARS
OLD
If
we had separated each expression
in
line 100 by a comma,
100
PRINT
"IN
THE
YEAR"
,F,"YOU
WILL
BE"
,N
,"
YEARS
OLD"
BASIC would move to the next tab position after printing each data
item.
2-140

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals