HP 50g User Manual page 677

Graphing calculator
Hide thumbs Also See for 50g:
Table of Contents

Advertisement

Thus, we demonstrated the use of function INFORM. To see how to use these
input values in a calculation modify the program as follows:
«
" CHEZY'S EQN" { { "C:" "Chezy's coefficient" 0} { "R:"
"Hydraulic radius" 0 } { "S:" "Channel bed slope" 0} } { } { 120
1 .0001} { 110 1.5 .00001 }
'C*(R*S)'
NUM "Q"
END »
The program steps shown above after the INFORM command include a
decision branching using the IF-THEN-ELSE-END construct (described in detail
elsewhere in this Chapter). The program control can be sent to one of two
possibilities depending on the value in stack level 1. If this value is 1 the
control is passed to the commands:
OBJ
These commands will calculate the value of Q and put a tag (or label) to it. On
the other hand, if the value in stack level 1 is 0 (which happens when a @CANCEL
is entered while using the input box) , the program control is passed to the
commands:
These commands will produce a message box indicating that the operation was
cancelled.
Note: Function MSGBOX belongs to the collection of output functions under
the PRG/OUT sub-menu.
under the PRG/BRCH/IF sub-menu. Functions OBJ ,
under the PRG/TYPE sub-menu. Function DROP is available under the PRG/
STACK menu. Functions
Example 2 – To illustrate the use of item 3 (Field format information) in the
arguments of function INFORM, change the empty list used in program INFP1
to { 2 1 }, meaning 2, rather than the default 3, columns, and only one tab stop
between labels and values. Store this new program in variable INFP2:
TAG ELSE "Operation cancelled" MSGBOX
DROP
C R S 'C* (R*S)'
"Operation cancelled" MSGBOX
Commands IF, THEN, ELSE, END are available
and
INFORM IF THEN OBJ
NUM are available in the keyboard.
DROP
NUM "Q"
TAG
TAG are available
C R S
Page 21-30

Advertisement

Table of Contents
loading

Table of Contents