Using Flags
You can use flags to control calculator behavior and program execution. You can think of a flag as a switch that is either on (set) or off (clear). You can test a flag’s state within a conditional or loop structure to make a decision. Because certain flags have unique meanings for the calculator, flag tests expand a program’s
Types of Flags
The calculator has two types of flags:
System flags. Flags
User flags. Flags 1 through 128. User flags are, for the most part, not used by any
Appendix C lists the 128 system flags and their definitions. For example, system flag
—when this flag is clear (the default state), the clock is not displayed — when this flag is set, the clock is displayed. (When you press %CLK% in the H%MISC% menu, you are setting or clearing flag
Note that for these calculators, there are no display annunciators to indicate that user flags 1 through 5 are set, like the older HP
Setting, Clearing, and Testing Flags
Flag commands take a flag number from the stack — an integer 1 through 128 (for user flags) or
To set, clear, or test a flag:
1.Enter the flag number (positive or negative).
2.Execute the flag command — see the table below.
Flag Commands
Key | Programmable | Description |
| Command |
|
|
|
|
!°%TEST% LL: |
| |
|
|
|
%SF% | SF | Sets the flag. |
%CF% | CF | Clears the flag. |
%FS?% | FS? | Returns 1. (true) if the flag is set, or |
|
| 0. (false) if the flag is clear. |
%FC?% | FC? | Returns 1. (true) if the flag is clear, |
|
| or 0. (false) if the flag is set. |
%FS?C% | FS?C | Tests the flag (returns true if the |
|
| flag is set), then clears the flag. |
%FC?C% | FC?C | Tests the flag (returns true if the |
|
| flag is clear), then clears the flag. |
|
|
|
RPL Programming