![HP 50G Скачать руководство пользователя страница 679](http://html.mh-extra.com/html/hp/50g/50g_user-manual_156571679.webp)
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:
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, the
2: v
1: 1
Содержание 50G
Страница 1: ...HP g graphing calculator user s guide H Edition 1 HP part number F2229AA 90006 ...
Страница 130: ...Page 2 70 The CMDS CoMmanDS menu activated within the Equation Writer i e O L CMDS ...
Страница 177: ...Page 4 10 Function DROITE is found in the command catalog N Using EVAL ANS 1 simplifies the result to ...
Страница 206: ...Page 5 29 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 257: ...Page 7 20 ...
Страница 383: ...Page 11 56 Function KER Function MKISOM ...
Страница 715: ...Page 21 68 Whereas using RPL there is no problem when loading this program in algebraic mode ...
Страница 858: ...Page L 5 ...