Now type RUN. As soon as you press your program. PET will execute 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. (But before we start a new program, let's type ne w and press your PET and thus avoids any confusion.) I tits is important: it clears aft previous programs in Type in: 10 PRINT "HELLO, HOW HOW ARE YOU?" RETURN 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 We have one too many HOWs in the line. Let's type LIST so we can see the line on the screen. pushing the key OFF RVS . Hold this key down while you watch the 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 loop." Statement 100 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 off the power-on switch not only 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.) 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. This is a STOP function when you do not press the SHIFT key. This will effectively "pull the plug on this 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 when it reached line R (or whatever line it was in your case) because you pressed the key You see how easy that was. 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. Do the same thing w i ll have eliminated the HOW: 12 13