# HP F2226A - 48GII Graphic Calculator User Manual Page 681

Graphing calculator.

Activation of the CHOOSE function will return either a zero, if a @CANCEL action
is used, or, if a choice is made, the choice selected (e.g., v) and the number 1,
i.e., in the RPN stack:
Example 1 – Manning's equation for calculating the velocity in an open
channel flow includes a coefficient, C
used. If using the S.I. (Systeme International), C
(English System), C
= 1.486. The following program uses a choose box to
u
let the user select the value of C
variable CHP1 (CHoose Program 1):
«
"Units coefficient" { { "S.I. units" 1}
{ "E.S. units" 1.486}
Running this program (press @CHP1) shows the following choose box:
Depending on whether you select
CHOOSE places either a value of 1 or a value of 1.486 in stack level 2 and
a 1 in level 1. If you cancel the choose box, CHOICE returns a zero (0).
The values returned by function CHOOSE can be operated upon by other
program commands as shown in the modified program CHP2:
«
"Units coefficient" { { "S.I. units" 1} { "E.S. units"
1.486}
} 1 CHOOSE IF THEN "Cu"
cancelled" MSGBOX END "
The commands after the CHOOSE function in this new program indicate a
decision based on the value of stack level 1 through the IF-THEN-ELSE-END
construct. If the value in stack level 1 is 1, the commands "Cu"
produced a tagged result in the screen. If the value in stack level 1 is zero,
2:
v
1:
1
, which depends on the system of units
u
= 1.0, while if using the E.S.
u
by selecting the system of units. Save it into
u
} 1 CHOOSE "
S.I. units
or
E.S. units,
function
TAG ELSE "Operation
TAG will
Page 21-32