Chapter
41
General Information
When modifying program lines, you can edit specific lines by
typing:
EDIT
line
number
[ENTER]
If the line number you specify does not exist, BASIC returns an
"Undefined line number" error.
You can also specify the current program line by using a period
(.I
instead of a line number:
EDIT
.
[ENTER)
The current line is the last line entered, the last line altered,
or
a line in which an error has occurred. Notice that you must type
a space before the period; otherwise, BASIC displays a "Syntax
error" message.
BASIC automatically enters EDIT when a syntax error occurs
when executing a program.
It
displays the line that contains the
error and waits for you
to
make corrections.
Sample Editing Session
This sample session shows how you can easily edit lines in
BASIC. Even though the sample
is
a BASIC program, you can
use the same procedure
for
command lines. All special keys used
in this session are described at the end
of
this chapter.
To begin the sample session, type the following line and press
m:
100
PRINT
"This
15
our
example
line."
Now use the
m
to
position the cursor on Line 100.
Use the
to
move across the line
to
the
T
in
This.
Type lower-
case and then
[ENTERJ.
Remember, none of the changes you
make
to
a program line are recorded until you press
m.
Type LIST 100 and press
[ENTERJ
to
see that BASIC has stored
your change in memory. BASIC displays:
100
PRINT
"this
15
our
example line."
Notice that you can make simple changes by typing over the old
material.
34