200 
GOTO
 200
 
 
RUN
 200
 
    This looks all set to go on for ever unless you pull the plug out; but there is a less drastic remedy. Press 
the 
SPACE
 key, which has 'BREAK' written above it. The program will stop, saying D/200.
 
    At the end of every program line, the computer looks to see if this key is pressed; & if it is, then it stops. 
The 
BREAK
 key can also be used when you are in the middle of using the tape recorder or the printer.
 
    You have now seen the statements 
PRINT
, 
LET
, 
INPUT
, 
RUN
, 
LIST
, 
GOTO
, 
CONT
, 
CLEAR
, 
NEW
 & 
REM
, & most of them can be used either as commands or as program lines - this is true of almost all 
statements in BASIC. The only real exception is 
INPUT
, which cannot be used as a command (you get 
report 8 if you try; the reason is that the same area inside the computer is used for both commands & for 
input data, & for an 
INPUT
 command there would be a muddle). 
RUN
, 
LIST
, 
CONT
, 
CLEAR
 & 
NEW
 are 
not usually much use in a program, but they can be used.
 
Summary
 
    Statements: 
GOTO
, 
CONT
, 
INPUT
, 
NEW
, 
REM
, 
PRINT
 
 
STOP
 in input data
 
 
BREAK
 
Exercises
 
1. In the square root program, try replacing line 40 by 
GOTO
 5, 
GOTO
 10 or 
GOTO
 15 - it should make no 
perceptable difference to the running of the program. If the line number in a 
GOTO
 statement refers to a 
non-existent line, then the jump is to the next line after. The same goes for 
RUN
; in fact 
RUN
 on its own 
actually means 
RUN
 0.
 
2. Run the string length program, & when it asks you for input type
 
        X$      (after removing the quotes)
 
    Of course, X$ is an undefined variable & you get report 2/110.
 
    If you now type
 
 
LET
 X$="SOMETHING DEFINITE"
 
(which has its own report of 0/0) &
 
 
CONT
 
you will find that you can use X$ as input data without any trouble.
 
    The point about this exercise is that 
CONT
 has the effect of 
GOTO
 110. It disregards the report 0/0 
because that had code 0, & takes its line number from the previous report, 2/110. This is intended to be 
useful. If a program stops over some error then you can do all sorts of things to fix it, & 
CONT 
will start 
work afterwards.
 
3. Try this program:
 
        10 
INPUT
 A$
 
        20 
PRINT
 A$;" = ";
VAL
 A$
 
        30 
GOTO
 10
 
(c.f. chapter 7, exercise 1).
 
    Put in extra print statements so that the computer announces what it is going to do, & asks for the input 
string with extravagant politeness.
 
4. Write a program to input prices & print out the VAT due (at 15%). Again, put in 
PRINT
 statements so that 
it tells you what it's doing. Modify the program so that you can also input the VAT rate (to allow for zero 
rating or future budgets).
 
5. Write a program to print a running total of numbers you input. (Suggestion: have two variables TOTAL -