Trident Help

RPN Advanced 42 manual · Chapter 13 of 18

Flags

Set, clear and test the 100 user flags, used mainly for decisions inside programs.

13.1Set, clear and test a flag#

A flag is a yes/no memory bit. There are 100 of them, numbered 00 to 99, all clear at first. Open FLAGS with shift 6. SF sets a flag, CF clears it, FS? asks whether it is set, FC? asks whether it is clear. FS?C and FC?C ask and then clear the flag. Type the flag number as two digits (or one digit and ENTER).

The FLAGS menu. The display shows: x: 0.0000 /  SF  CF FS? FC? FSC FCC.
The FLAGS menu.
Example 13.1

Set a flag and test it

  1. Set flag 05 with SF (first key).

    ⇧FLAGS6Σ+05
  2. Ask if flag 05 is set with FS? (third key).

    √x05
    After step 2: Ask if flag 05 is set with FS? (third key). The display shows: Yes /  SF  CF FS? FC? FSC FCC.
Result of the example "Set a flag and test it" The display shows: Yes /  SF  CF FS? FC? FSC FCC.
You should seeYes
Example 13.2

Clear a flag

  1. Set then clear flag 05, then test it.

    ⇧FLAGS6Σ+051/x05√x05
Result of the example "Clear a flag" The display shows: No /  SF  CF FS? FC? FSC FCC.
You should seeNo
Example 13.3

Test and clear

  1. FS?C answers Yes and clears the flag; the next test says No.

    ⇧FLAGS6Σ+07LN07√x07
Result of the example "Test and clear" The display shows: No /  SF  CF FS? FC? FSC FCC.
You should seeNo

HP-42S is a trademark of HP Inc.. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by HP. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.