Radio Shack TRS-80 Model 100 Basic Manual page 91

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Press
(BKSP)
and then
CD,
to change the
6
to a
7.
These two lines will now appear as:
60
PI~I!\IT
70
P!~~I!'rf"
" .c'\'-v'ERl\(;;iE
"
AVEI~AGE
I
F~
If
~
.,.
f"'~
H
u
1
~~
'J
t.\)/
,6,"/
i
cr~
Line 70 is in the desired form. Move the cursor to line 60 so that it is on the space
after AVERAGE. Line 60 will appear as:
6iZ! P R I NT
II
AVE
!'I;~jl:::.!'!lF!j" ~:;" ~
,tV).I
CT.
Press
(BKSP)
until the word AVERAGE is erased. Then type in the word SUM. Line
60 will be:
60 PRINT "SUM IS"; AV/
The last step is to delete the characters
"/CT" at the end of the line. Move the cursor
to the end of the line so that it is over the carriage return character
0
6
r
1>
FjR I I,.,oor "CUlv' I
Co".
A'
J
i
('OOf".·"··
l,(J
i~
-...J
11
~_,
~
.
\0'.'
'-'
.
.
Press
~
three times to erase the characters. Line 60 will be in the desired form
60 PRINT "8UM IS"; Av4
Exit from the Editor. List the program to confirm that it is:
1121 INPUT "NUMBER"; N
2121 IF N=12I THEN GOTO SI2I ELSE CT = CT
+
1
1112l
AV
=
AV
+
N
5121 GOTO 1121
SI2I PRINT "SUM IS"; AV
7121 PRINT "AVERAGE IS"; AV/CT
Execute the program. Here is an example of the output:
NUMBER? ·4
NUMBER'7
2
NlJl"IJ3ER? 0
SUi'1 TE) 6
A\,JE
::-~ACiE
I
~3
3
Recall that if a BASIC program is SAVEd in RAM but changes are made to it when
the program is LOADed in working memory, the program SAVEd in RAM will
reflect those changes
0
85

Advertisement

Table of Contents
loading

Table of Contents