Contents
Contents........................................................................................................................................................................................ 1
1. RPL Programming................................................................................................................................................................. 1-1
Understanding Programming .............................................................................................................................................1-1
The Contents of a Program ......................................................................................................................................... 1-1
Calculations in a Program ........................................................................................................................................... 1-2
Entering and Executing Programs......................................................................................................................................1-3
Viewing and Editing Programs ..........................................................................................................................................1-6
Creating Programs on a Computer .....................................................................................................................................1-7
Using Local Variables........................................................................................................................................................1-7
Creating Local Variables............................................................................................................................................. 1-7
Evaluating Local Names ............................................................................................................................................. 1-8
Compiled Local Variables......................................................................................................................................... 1-10
Testing Conditions .................................................................................................................................................... 1-11
Using Loop Structures......................................................................................................................................................1-17
Using Definite Loop Structures ................................................................................................................................ 1-17
Using Indefinite Loop Structures .............................................................................................................................. 1-21
Using Loop Counters ................................................................................................................................................ 1-24
Using Flags.......................................................................................................................................................................1-25
Types of Flags........................................................................................................................................................... 1-26
Using Subroutines ............................................................................................................................................................1-28
Single-Stepping through a Program .................................................................................................................................1-29
Trapping Errors ................................................................................................................................................................1-32
Causing and Analyzing Errors .................................................................................................................................. 1-32
Making an Error Trap ............................................................................................................................................... 1-33
Input .................................................................................................................................................................................1-35
Data Input Commands............................................................................................................................................... 1-35
Using PROMPT ... CONT for Input ........................................................................................................................ 1-35
Using DISP FREEZE HALT ... CONT for Input .................................................................................................... 1-37
Using INPUT ... ENTER for Input .......................................................................................................................... 1-38
Beeping to Get Attention .......................................................................................................................................... 1-45
Using WAIT for Keystroke Input ............................................................................................................................. 1-46
Using KEY for Keystroke Input ............................................................................................................................... 1-46
Output ....................................................................................................................................................................... 1-46
Data Output Commands............................................................................................................................................ 1-47
Labeling Output with Tags ....................................................................................................................................... 1-47
Pausing to Display Output ........................................................................................................................................ 1-48
Using MSGBOX to Display Output ......................................................................................................................... 1-49
Using Menus with Programs ............................................................................................................................................1-49
Using Menus for Input .............................................................................................................................................. 1-50
Using Menus to Run Programs ................................................................................................................................. 1-50
2. RPL Programming Examples ................................................................................................................................................ 2-1
Fibonacci Numbers ............................................................................................................................................................2-1
Contents -1