Radio Shack TRS-80 Model 100 Basic Manual page 80

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

Advertisement

Execute the program. You will have to enter one of the names listed in the Data
statements, or an Out of Data error will occur. Here is an example of the output:
N ,0. 1' 1
f:::
?
RON
YOUR AGE If3
Ok
~.m
Execute the program several times, entering different names.
Experiment #3 Deleting a Character
In addition to inserting a character, the Editor can be used to delete a character. This
is easily done and will be illustrated in this experiment. The variable AG in lines 20
and 40 of the previous program will be changed to the single letter G.
Type the command
ED I T (ENTER)
to invoke the Editor. The following should be displayed:
10 INPUT "NAME"; N$
30 IF AS<>N$ THEN GOTO
20~
40 PRINT "YOUR AGE IS", AG
50 DATA DAN, 32, RON, 38, LINDA,
42~
60 DATA BETTY, 35, RALPH. 29, SKIP,
The A in the variable AG in line 20 will be deleted first. Position the cursor with the
arrow keys so that it is over the letter G. Line 20 should appear as
Note that the cursor is positioned to the right of the character to be deleted. Now press
CIKSf). Line 20 will now appear as
Notice that the letter A has been deleted as desired and that the characters which were
to the right of the deleted letter A have been moved to the left one position. Also note
that the cursor is still positioned over the letter G.
74

Advertisement

Table of Contents
loading

Table of Contents