Reference Guide
RPL Programming 1-51
Example:
The following program TSTRING is identical to TINPUT, except that it converts the program result to
a string and appends a labeling string to it.
Program: Comments:
«
"Key in a, b"
Converts the result to a string.
{ ":a::b:" {1 0} V}
INPUT OBJ→
TORSA
→STR
"Area = "
Enters the labeling strings.
SWAP +
Swaps and adds the two strings.
CLLCD 1 DISP
3 FREEZE
Displays the resultant string,
without its delimiters, in line 1 of
the display.
»
`O
TSTRING ‰
Stores the program in TSTRING.
Execute TSTRING to calculate the area of the torus with a = 1.5 and b = 1.85. The labeled answer appears in the
status area.
@·
J
%TSTRI%
1.5 ˜1.85 `
Pausing to Display Output
To pause to display a result:
1.
Enter commands to set up the display.
2.
Enter the number of seconds you want to pause.
3.
Enter the WAIT command (PRG IN menu).
WAIT suspends execution for the number of seconds in level 1. You can use WAIT with DISP to display messages
during program execution — for example, to display intermediate program results. (WAIT interprets arguments 0
and –1 differently — see “Using WAIT for Keystroke Input” on page 1-48.)
Using MSGBOX to Display Output
To set up a message box:
1.
Enter a message string.
2.
Execute the MSGBOX command.
Example:
Enter the string
"HELLO, WORLD"
`
.
Execute MSGBOX (!°L
%OUT% %MSGBO%
).
The following message appears: