Lesson #6 Using The Editor - Radio Shack TRS-80 Model 100 Basic Manual

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

Advertisement

Lesson #6 Using the Editor
In this lesson you will learn how to use the built-in Editor of the Model 100 so that
changes to a BASIC program can be made quickly and easily.
Until now, you have been able to make changes to your BASIC programs in the
following three ways:
I) An existing line is changed by retyping it.
2) An existing line is deleted by entering just the line number.
3) A new line is added by entering it with the appropriate line number.
While any change to your program can be accomplished using these three procedures,
they can be time consuming. For example, if you only want to change a single
character in a line of your program, the entire line must be retyped. If you want· to
move one line to another location in the program, the old line must be deleted and the
line retyped with a new line number.
An
easier and more efficient way to make changes of this type is to use the built-in
Editor. The Editor allows changes to be made to a line without retyping the entire
line. It also allows a line number to be changed without retyping the line.
There are other convenient features of the Editor as well. These features will be
examined in detail.
Experiment #1 Inserting a Character
Enter the following program from the keyboard exactly as it is printed here:
10
INPUT
~NAME";
N$
20
READ A$, AG
30
IF A$
<
>
N$ THEN GOTO 20
00
PRINT
~AGE
IS", A
50
DATA DAN, 32, RON, 38, LINDA, 02
80
DATA BETTY, 35, RALPH, 29, SKIP, 3
This program prompts you for a name. If one of the names in the DATA statements is
entered, (i.e. BETTY), the corresponding age (35) will be displayed. If the name
entered is not found in the DATA statements, an out of data error will result (at least
that is how the program is supposed to work).
69

Advertisement

Table of Contents
loading

Table of Contents