Creating a choose box, Creating a choose box ,21-31 – HP 50g Graphing Calculator User Manual

Page 678

Advertising
background image

Page 21-31

«

“ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:”

“Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } {

2 1 } { 120 1 .0001} { 110 1.5 .00001 } INFORM IF THEN

OBJ

DROP

C R S ‘C*(R*S)’

NUM “Q”

TAG ELSE

“Operation cancelled” MSGBOX END

»

Running program

@INFP2 produces the following input form:

Example 3 – Change the field format information list to { 3 0 } and save the
modified program into variable INFP3. Run this program to see the new input
form:

Creating a choose box

Function CHOOSE („°L

@)@@IN@@ @CHOOS@) allows the user to create a

choose box in a program. This function requires three arguments:

1. A prompt (a character string describing the choose box)
2. A list of choice definitions {c

1

c

2

… c

n

}. A choice definition c

i

can have

any of two formats:

a. An object, e.g., a number, algebraic, etc., that will be

displayed in the choose box and will also be the result of the
choice.

b. A list {object_displayed object_result} so that object_displayed

is listed in the choose box, and object_result is selected as the
result if this choice is selected.

3. A number indicating the position in the list of choice definitions of the

default choice. If this number is 0, no default choice is highlighted.

Advertising