1-36 RPL Programming
Example: If you execute this program segment
! "!IBSObI!2KLM2:!1!
the display looks like this:
Example: The following program, TPROMPT, prompts you for the dimensions of a torus, then calls program
TORSA (from page 1-28) to calculate its surface area. You don't have to enter data on the stack prior to program
execution.
Program: Comments:
"!
I<=:<K!$F!%!6=!LK4<KlI
Puts the prompting string on the stack.
2KLM2:
Displays the string in the status area,
halts program execution, and returns
calculator control to the keyboard.
:LKDB
Executes TORSA using the just-entered
stack arguments.
»
`OTPROMPT ‰
Stores the program in TPROMPT.
Execute TPROMPT to calculate the volume of a torus with inner radius a =8 and outer radius b =10. Execute
TPROMPT. The program prompts you for data.
@·J %TPROM%
Enter the inner and outer radii. After you press `, the prompt message is cleared from the status area.
8 `10