User`s manual

4-6
END
Terminates execution normally (without a BREAK message). Some versions
of BASIC require END as the last statement in a program; with LEVEL 11 it
is optional. END is primarily used to force execution to terminate at some
point other than the physical end of the program.
Example:
10 INPUT S1,S2
20 GOSUB 100
.
.
.
99 END
100 H=SQR(S1*S1+S2*S2)
110 RETURN
The END statement in line 99 prevents program control from "crashing" into
the subroutine. Now line 100 can only be accessed by a branching statement
such as 20 GOSUB 100.
STOP
Interrupts execution and prints a BREAK IN
line number
message. STOP is
primarily a debugging aid. During the break in execution, you can examine or
change variable values. The command CONT can then be used to re-start
execution at the point where it left off. (If the program itself is altered during
a break, CONT cannot be used.)
Example:
10 X=RND(10)
15 STOP
20 GOSUB 1000
RUN
BREAK IN 15
READY
>_
Suppose we want to examine what value for X is being passed to the
subroutine beginning at line 1000. During the break, we can examine X with
PRINT X. (You can delete line 15 after the program is debugged.)