Section 9
Program Interruptions
In your programs, there may often be occasions when you want to halt execution so that you can key in data, or to pause so that you can quickly view results before the program automatically resumes. This section shows you how to use STOP and PSE for program interruptions, as well as how the keyboard can be used to stop execution with R/S , and how an error can halt a running program.
Using STOP and R/S
The STOP function can be placed into a program as an instruction by pressing the R/S (run/stop) key or by usng XEQ and spelling the name (STOP). When executed in the program, the STOP stops program execution after its line of program memory.
R/S function is only a keyboard function, that is, it cannot be recorded as an instruction in a program. However, when you press the R/S key in PRGM mode, a STOP instruction is recorded in the program. When you press the R/S key and the calculator is not in PRGM mode:
  1. If a program is running, a STOP is executed and program execution is halted. The only keys that can halt a running program (from the keyboard) are the ON and R/S keys.
  2. If a program is stopped or not running R/S starts the program running beginning with the current line in the program.
When using R/S to halt a running program, remember that only the R/S key location in the lower right-hand position of the keyboard, performs the run/stop function. This is true even in USER mode, regardless of where STOP is assigned to that location.
Example: The following program calculates the volume of a sphere given its radius. The program stops execution (with STOP ) to let you key in the value of the radius of the sphere.
The formula for finding the volume of a sphere is V = (4πr3)÷3.