
Page 21-32
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:
2: v
1: 1
Example 1 – Manning’s equation for calculating the velocity in an open
channel flow includes a coefficient, C
u
, which depends on the system of units
used. If using the S.I. (Systeme International), C
u
= 1.0, while if using the E.S.
(English System), C
u
= 1.486. The following program uses a choose box to
let the user select the value of C
u
by selecting the system of units. Save it into
variable CHP1 (CHoose Program 1):
«
“Units coefficient” { { “S.I. units” 1}
{ “E.S. units” 1.486} } 1 CHOOSE
»
Running this program (press
@CHP1
) shows the following choose box:
Depending on whether you select
S.I. units
or
E.S. units,
function
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”
TAG ELSE “Operation
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”
TAG
will
produced a tagged result in the screen. If the value in stack level 1 is zero,
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...