This
chapter descnbes the program editor
We
shall include a
few
simple examples, but
the best
way
to
learn
is
by
uSing
them
yourself
Start
by
typing new
to
clear
the
computer's
memory.
When you have read this chapter you could try
wntlng a
few
simple programs
of
your
own, or
you
could try modifying the procedures you typed
In
while working
on
the
last
chapter.
If
you want
to
use longer examples
you
could use the editor
to
type
in
all
or
part of the programs
In
the following chapters.
You
enter the mam level
of
the program editor
With
the edit
As an example
we
can create a procedure and add a couple of statements
to
It From
the main
level
of edit, press F3 and N
to
create a new procedure.
Type
In
test when
prompted for the name of the procedure.
Press ESC twice
to
leave the editor
Without
adding any statements. Then use the edit
command
again.
If
you have no other procedures loaded, the screen
will
show:
test
proc
test
endproc
If
the procedures
you
created
in
the
last
chapter are
still
loaded, then test
IS
highlighted
on
the left
as
the current procedure among these other procedures. Press
F4
to
Insert
lines of
text.
The line containing proc
will
be highlighted.
Now type:
print
"this
is
a
test"IENTERI
print
"there
are
two
statements"
IENTERIIENTERI
Pressing ENTER twice
In
succession takes you out of
insert
When
you
have finished
the screen
will
look
like:
CHAPTER
9
EDITING
THE
PROGRAM
EDITOR
test
proc
test
print
"th;
5 ; 5 a
test"
print
"there
are
two
statements"
endproc
The line containing the second pnnt statement
is
highlighted.
Remember that
until
you
press ENTER
you
can use the line editor
to
correct any
text
that you type.
However,
once
you
have pressed ENTER the line
IS
inserted into the
procedure.
To
get
It
out again
to
edit
it
you
must press
F5.
Pressing ENTER
Will
then
replace the old line with the new
line.
You
are not allowed
to
edit the endproc statement at the end of the procedure.
You
are
also not allowed
to
edit the word proc but
you
may edit the
rest
of
the contents of
thiS
line.
You
can, therefore, rename a procedure by using the line editor
to
delete the old
name and replace
it
with a new
one.
The
list
of procedures
at
the
left
of
the screen
IS
rearranged automatically
to
keep the procedures
in
alphabetical order
There are four separate editing commands which
you
Will
have noticed
in
the command Editing Commands
section when creating a new procedure.
You
can select one
by
pressing F3 and then
typing the
first
letter of
its
name.
You
type
in
the name of the procedure
you
want
to
create.
If
you
type
in
the name of New Procedure
(N)
an existing procedure, you
Will
not be allowed
to
create a second procedure but will
be offered the option of
editing the existing procedure.
When
you
press ENTER at the end
of
the name the new procedure becomes the current
one,
listed at the right of the screen.
You
are presented with an empty procedure -
that
is,
one containing only the proc and endproc statements.
This command deletes the current procedure from your program.
You
must first select Delete Procedure
(D)
the procedure
you
want
to
delete
by
using
the
SHIFT and TABULATE
keys,
as
described
earlier,
to
make
It
the current procedure.
You
then select the command
by
pressing F3
and then the D
key.
You
must press ENTER
to
confirm that
you
really
do
want
to
delete the procedure.
If
you
change your mind at this stage you can press any other
key
to
go back
to
edit
without deleting the procedure.
12/84
19