RPL Programming 1-27
Example:
Program: Comments:
"!
67!
0aH!7Ob!
:;<=!
cd3QH88e!
<ED<!
3Qd8cH88e!
<=4!
3ed8Q!I:<D:!OLM2E<:<I!
V!#E6D:!D:LBEBKM
Tests the status of flag –42, the Date
Format flag.
If flag –42 is clear, supplies the date in
month/day/year format.
If flag –42 is set, supplies the date in
day.month.year format.
Ends the conditional.
Sets the alarm: 17.05 is the alarm time
and “TEST COMPLETE” is the alarm
message.
»
Example: User Flag. The following program returns either the fractional or integer part of the number in
level 1, depending on the state of user flag 10.
Program: Comments:
"!
67!
38!7Db!
:;<=!
62!
<ED<!
72!
<=4
Starts the conditional.
Tests the status of user flag 10.
If flag 10 is set, returns the integer part.
If flag 10 is clear, returns the fractional part.
Ends the conditional.
»
To use this program, you enter a number, either set flag 10 (to get the integer part) or clear flag 10 (to get the
fractional part), then run the program.
Recalling and Storing the Flag States
If you have a program that changes the state of a flag during execution, you may want it to save and restore
original flag states.
The RCLF (recall flags) and STOF (store flags) commands let you recall and store the states of the
hp49g+/hp48gII flags. For these commands, a 64-bit binary integer represents the states of 64 flags — each 0
bit corresponds to a flag that's clear, each 1 bit corresponds to a flag that's set. The rightmost (least significant)
bit corresponds to system flag –1 or user flag 1 for the lower groups and system flag -65 or user flag 65 for the
upper groups.
To recall the current flag states:
! Execute RCLF (!°L %MODES% %FLAG% L%RCLF% ).
RCLF returns a list containing four 64-bit binary integers representing the current states of the lower and upper
groups of system and user flags:
f gn
system-lower
gn
user-lower
gn
system-upper
gn
user-upper
h!!