Exercise 7 - Screen Editing - Commodore PET 2001 Series Introduction Manual

Hide thumbs Also See for PET 2001 Series:
Table of Contents

Advertisement

Now type RUN. As soon as you press
your program.
Rockets should be flashing on the screen so fast that it may be
difficult to see them. The speed at which characters are printed on
the screen can be controlled while the program is running by
OFF
.
pushing the key
Hold this key down while you watch the
RVS
screen. Now, release the key. Use of this key reduces the printing
speed to about 2 lines per second.
The program you have created contains what is called an "infinite
100
loop." Statement
does not contain a condition to stop
running the program and cease printing the rocket, but
unconditionally goes to the start of the program over and over. It will
continue like this forever unless you pull the plug.
(Pulling the plug or shutting
stops the program, it also destroys the program statements. You'
ve put in a lot of time typing theta and stay not want them
destroyed.)
do
press the
key. This will effectively "pull the plug on this
SHIFT
program, without losing the program statements.
PET will respond with something like:
BREAK IN LINE 8
This message means that execution of your program was stopped
i t r e a c h e d l i n e R ( o r whatever line it was
you pressed the
key
At this point you may want to save your program. See page 31, "
Using your Cassette to Save a Program. "

Exercise 7 - Screen editing

One of the handiest features of PET is the ability to modify easily
the program you have entered, as we have just seen.
12
PET will execute
off
the power-on switch not only
This is a STOP function when you
w h e n
in your case) because
You can change a single character or you can add characters to lines you
already have. You can see exactly what you are changing because the
changes are visible as you enter them.
Let's try it.
we start a new program, let's type ne
(But before
tits is important: it clears aft previous programs in
your PET and thus avoids any confusion.)
Type in: 10
PRINT "HELLO, HOW HOW ARE YOU?"
We have one too many HOWs in the line. Let's type LIST so we can
see the line on the screen.
This will move the cursor
tip
two lines from its lower position to the
first position of line 10.
is over the space after the W in either one of the HOWs.
You see how easy that was.
Do the same thing
i
eliminated the HOW:
ll have
w
and press
w
RETURN
13

Advertisement

Table of Contents
loading

Table of Contents