|
A program is nothing more than a sequence of manual keystrokes that is remembered by the calculator. You can then execute the program as often as you like – typically with just one keystroke. The answer dis- played at the end of execution is the same one you would have obtained by pressing the keys one at a time manually. No prior programming experience is necessary for RPN-38 calculator programming.
To get you started, try entering and executing the simple program shown on the Info screen of RPN-38 CX (tap the info button in the lower-left corner).
Entering and running a program
- Tap g P/R (or the P/R shortcut key) to enter program mode.
- To clear the program memory, tap g CLP.
- Enter your program steps
- Tap g P/R to return to run mode. If you haven't turned off "RUN From Step 0" in Settings, line 00 is automatically selected.
- Tap R/S to run the program.
Reviewing your program
- Tap g P/R (or the P/R shortcut key) to re-enter program mode.
- Tap g SST (or the SST shortcut key) to single-step through your program lines.
Likewise, use BST to back-step.
- Alternatively, tap the display in program mode to see the entire listing.
Debugging your program
- Tap g SST (or the SST shortcut key) in run mode to execute your program step-by-step.
- While the SST key is depressed, the display shows the instruction about to be executed.
- After the step is executed, the next step number appears shortly at the left.
- Use BST to back-step without executing the steps.
Editing your program
- To insert a step after the current step, simply enter the desired key or keys.
- To delete a step, tap g DEL (or the DEL shortcut key at the top).
You may also delete steps directly in the program listing (see picture at right).
- To delete all steps from the current to the end, tap f DLEnd
- To delete a range of steps
In RUN mode, enter the range in X and Y
Tap g DEL –OR– Return to PRGM mode and tap g DLx,y
- To find a step, tap GTO . nn, where nn is the desired step (2 digits).
In run mode, the decimal point is not required.
- To find the last step of your program, tap GTO . . (two decimal points).
Adding or removing steps will automatically adjust all affected GTO commands.
For example, if you enter GTO 40 after step 10 to branch to line 40, what gets stored is GTO 41, since your instruction
caused the rest of program memory to move down one line.
However, if the GTO's target lies in the unused program area past your last program step, no adjusting takes place.
Programming the mode switch
The mode switch (also called "payment switch") may be set under program control.
The required program step, "D.MY/BEGIN" or "M.DY/END" is entered like this:
- In program mode, set the switch to the desired position.
- Tap g, then tap the switch.
Reading the mode switch
The current position of the mode switch may be read under program control.
The required program step, "M.DY/END?", is entered like this:
- Tap f, then tap the switch.
If true, i.e. the switch is in the right position, the following step is executed, otherwise it is skipped.
Indirect Addressing (STi, RCi)
- All 20 registers may be accessed indirectly via the I register.
- Indirect addressing may be enabled/disabled by pressing f ENTER in PRGM mode
- Store the desired register number in I (using x≷I), then execute
STi to store x in that register, RCi to recall it
- STi is performed by the key sequence g f, and RCi by f g
- The indirection register I may contain any value in the range 0..19.
Sign and decimal digits are ignored.
Note that the indirection register I may be incremented, decremented and tested by the loop control instructions DSE and ISG.
Example program
- Enter the 20-step program shown at right (top).
- After tapping P/R to return to run mode, step 00 should be addressed. If in doubt, tap the display and check
the entry labeled Line in the register view. There are several ways to go to step 0: tap P/R twice, or execute GTO 00, or execute g CLP.
- The sample program finds the sum and percentage of total of up to 20 numbers.
Example: Find the percentage that each of the following numbers represent of the total sum of the numbers: $54, $14, $83, $144, and $38.
Keys: |
Display: |
Description: |
|
|
|
0 R/S |
0.00 |
Initialize CF0 with zero. |
54 R/S |
54.00 |
Key in first number. |
14 R/S |
68.00 |
Sum of first two numbers. |
83 R/S |
151.00 |
Sum of first three numbers. |
144 R/S |
295.00 |
Sum of first four numbers. |
38 R/S |
333.00 |
Sum of all numbers entered. |
Now tap 0 R/S to tell the calculator that you have finished keying in the numbers
so that it can branch to the %T portion of the program. The calculator will pause about
2 seconds to display each of the following:
Keys: |
Display: |
Description: |
|
|
|
0 R/S |
38.00 |
Last number you keyed in. |
|
11.41 |
% of total. |
|
144.00 |
4th number you keyed in. |
|
43.24 |
% of total. |
|
83.00 |
3rd number you keyed in. |
|
24.92 |
% of total. |
|
14.00 |
2nd number you keyed in. |
|
4.20 |
% of total. |
|
54.00 |
First number you keyed in. |
|
16.22 |
% of total. |
To recall the total again, simply tap x≷y.
Using GTOs and GSBs correctly
When inserting or deleting program steps, RPN-38 automatically readjusts all affected GTO and GSB
branch instructions. This huge time-saver is not entirely free of pitfalls.
For details, click here.
|
|
|
|
Managing programs on RPN-38 CX |
|
|
|
|
|
|
|
Use P/R to select program mode.
Tap the display to open the program listing.
Note that the current step is highlighted:
|
|
|
|
 |
|
|
|
|
|
|
|
Steps may be deleted by swiping left across the line: |
|
|
|
 |
|
|
|
|
|
|
|
Tap Save to copy the changed program to the calculator.
To exit without changing the program, tap Cancel.
If you select a line before exiting, the line will be shown on the calculator.
|
|
|
|

 |
|
|
|
|
|
|
|
Exporting a program |
|
|
|
A program may be saved for archiving purposes.
- Tap Programs
- Tap Export
This will save the program, display format, odd-period flag "C", and mode switch position.
or
- Tap Export w/Regs
This will additionally save all storage and financial registers.
- The program will be saved in RPN-38's Documents folder on your iPhone under the name you've given it as title.
- If desired, use iTunes File Sharing to copy the program to your computer for archiving.
|
|
|
|
 |
|
|
|
- Programs may have any name as long as the extension .rpn38 is preserved.
|
|
|
|
|
|
|
|
Importing a program |
|
|
|
To import a program from the Documents folder:
- Tap Programs
- You'll be presented with a list of all stored programs.
- Pick a program and tap Import.
or
Double-tap a program.
- If the program was stored with registers, you have several options:
• Import program and settings only
• Import program and primary registers R0..R9
• Import program and secondary registers R.0..R.9
• Import program and all registers

- The imported program will replace your current program, including title, description, modification date,
display format, odd-period flag, and mode-switch position.
- If you want to load the imported program into the calculator, be sure to tap Save.
Tap Cancel to ignore the import and return to the calculator.
Note:
An empty program saved with registers will only replace the registers, leaving the program memory untouched.
This feature may be used to create pure data files.
|
|
|
|
|
|
|
|
Deleting the current program
|
|
|
|
A. To delete the currently stored program and all metadata:
- In the program listing view, tap New.
- Tap Save to send the empty program to the calculator.
or
Tap Cancel to return without any changes.
B. To delete the currently stored program, but keep title and description:
- In the calculator view, tap g CLP (in program mode).
If program memory is not empty, a warning message appears.
|
|
|
|
|
|
|
|
Deleting an exported program |
|
|
|
- In the program listing view, tap Programs
- In the list of stored programs, swipe left across the program name.
or
Tap the red Delete button.
A warning message appears in both cases.
|
|
|
|
|
|
|
|
Printing and PDF creation |
|
|
|
- In the program listing view, tap Print to send the listing to any attached printer.
- Tap P to send the program description to any attached printer.
(The P appears only if the description is not empty.)
- To create a PDF document of the listing or the description:
– Tap Print or P to see the preview
– Long-press the preview. You will see an enlarged view.
– Tap the enlarged view, then tap the Share button in the top-right corner.
|
|