If you don't want the program to stop, see "Displaying Information without Stopping" below. Example: INPUT, VIEW, and Messages in a Program. Write an equation to find the surface area and volume of a cylinder given its radius and height. Label the program C (for cylinder), and use the variables S (surface area), V (volume), R (radius), and H (height). Use these formulas: V = .R2H S = 2.R2 + 2.RH = 2.R ( R + H ) Keys: Display: Description: (In RPN mode) ... Program, entry; clears the .(....) .... ... program memory. O.... ... .... ... . Labels program. .CR .... ..... . .CH .... ..... . Instructions to prompt for radius and height. 13-16 Simple Programming Keys: (In RPN mode) .... .R... .H. .. .V ...... ...R. 4 .R. .H. .. .S ... (...) .. ..V .O.L .... ..A .R.E .A. ... (...) .. ..V ..S .. ... (....) .. .. Display: .... ....... ....... .... .... ... . .... .........• ....... ..... .... ... . .... .. .. .... ... . ...• .... .. .. .... .... . .... .... . .... ... ... . ..... ....... ..... Description: Calculates the volume. Checksum and length of equation. Store the volume in V. Calculates the surface area. Checksum and length of equation. Stores the surface area in S. Sets flag 10 to display equations. Displays message in equations. Clears flag 10. Displays volume. Displays surface area. Ends program. Displays label C and the length of the program in bytes. Checksum and length of program. Cancels program entry. Simple Programming 13-17 Now find the volume and surface area–of a cylinder with a radius of 2 1/2 cm and a height of 8 cm. Keys: Display: Description: (In RPN mode) .C. .. Starts executing C; prompts for value R. (It displays whatever value happens to be in R.) ..... .. Enters 2 1/2 as a fraction. value Prompts for H. . .. ... . .... Message displayed. . .. Volume in cm3. ........ . .. Surface area in cm2. ........ Displaying Information without Stopping Normally, a program stops when it displays a variable with VIEW or displays an equation message. You normally have to press . to resume execution. If you want, you can make the program continue while the information is displayed. If the next program line — after a VIEW instruction or a viewed equation — contains a PSE (pause) instruction, the information is displayed and execution continues after a 1–second pause. In this case, no scrolling or keyboard input is allowed. The display is cleared by other display operations, and by the RND operation if flag 7 is set (rounding to a fraction). Press .. to enter PSE in a program. The VIEW and PSE lines — or the equation and PSE lines — are treated as one operation when you execute a program one line at a time. 13-18 Simple Programming Stopping or Interrupting a Program Programming a Stop or Pause (STOP, PSE) • Pressing .(run/stop) during program entry inserts a STOP instruction. This will display the contents of the X-register and halt a running program until you resume it by pressing . from the keyboard. You can use STOP rather than RTN in order to end a program without returning the program pointer to the top of memory. • Pressing .. during program entry inserts a PSE (pause) instruction. This will suspend a running program and display the contents of the X– register for about 1 second — with the following exception. If PSE immediately follows a VIEW instruction or an equation that's displayed (flag 10 set), the variable or equation is displayed instead — and the display remains after the 1–second pause. Interrupting a Running Program You can interrupt a running program at any time by pressing .or .. The program completes its current instruction before stopping. Press .(run/stop) to resume the program. If you interrupt a program and then press ., ., or .., you cannot resume the program with .. Re-execute the program instead (.label line number). Error Stops If an error occurs in the course of a running program, program execution halts and an error message appears in the display. (There is a list of messages and conditions in appendix F.) To see the line in the program containing the error–causing instruction, press . .. The program will have stopped at that point. (For instance, it might be a . instruction, which caused an illegal division by zero.) Simple Programming 13-19 Editing a Program You can modify a program in program memory by inserting, deleting, and editing program lines. If a program line contains an equation, you can edit the equation. To delete a program line: 1. Select the relevant program or routine and press O or . to locate the program line that must be changed. Hold the cursor key down to continue scrolling. 2. Delete the line you want to change —press . directly (Undo function is active). The pointer then moves to the preceding line. (If you are deleting more than one consecutive program line, start with the last line in the group.) 3. Key in the new instruction, if any. This replaces the one you deleted. 4. Exit program entry ( .or ..). To insert a program line: 1. Locate and display the...