Radio Shack TRS-80 Model 100 Basic Manual page 82

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

Advertisement

Again you will see displayed:
,1~
INPUT
"NAME"; N$<IIi
2L'l
F~EAD
A~i.
(";:j
4!l
30 IF A$<>N$ TI-·lE!\1 GUrU
2(;.~1Ili
40
PRINT "YOUR
AGE IS".
G
50
DATA DAN.
32.
RON,
38.
LINDA,
42
60 DATA BETTY, 35. RALPH, 29, SKIP,
]~
....
Position the cursor so that it is on the space preceding the variable G in line 40. When
this is done, line 40 should appear as
·4«:1 PRINT
"YOUR A<:iE IS".
·4
Press COkSP) on the keyboard. This will delete the character just to the left of the
cursor. After this is done line 40 will appear as
40 PRINT "YOUR AGE IS"
4
Note that the cursor
IS
still on the space which precedes G, thus it is in the correct
position to insert the semicolon. Type a semicolon. Line 40 should now appear as:
£10 PRINT "YOUR AGE 15"; G
This is the desired form of line 40. You must remember that when COKSP) is used, the
character deleted will be the one just to the left of the cursor. If the deletion is done
ftrst, then the cursor will be positioned correctly for the insertion of the new character.
The operation can be carried out in the reverse order, but after the insertion, the cursor
must be moved one position to the right before the deletion is done.
Exit from the Editor by pressing the Escape key twice, or just hit (fS).
Execute the program several times to conftrm that it is working correctly.
Experiment #5 Changing a Word
List the previous program. You should see:
10 INPUT "YOUR NAME"·; N$
20 READ A$t G
30 IF A$
< >
N$ THEN GO TO 20
£10 PRINT "YOUR AGE 15"; G
50 DATA DANt 32t RONt 38t LINDAt £12
80 DATA BETTYt 35t RALPHt 29t SKIPt 3
76

Advertisement

Table of Contents
loading

Table of Contents