![HP 50G User Manual Download Page 688](http://html.mh-extra.com/html/hp/50g/50g_user-manual_156571688.webp)
Page 21-41
Incorporating units within a program
As you have been able to observe from all the examples for the different
versions of program
@@@p@@@
presented in this chapter, attaching units to input
values may be a tedious process. You could have the program itself attach
those units to the input and output values. We will illustrate these options by
modifying yet once more the program
@@@p@@@
, as follows.
Recall the contents of program
@@@p@@@
to the stack by using
‚
@@@p@@@
, and modify
them to look like this:
«
“
Enter V,T,n [S.I.]:
“
{
“
:V:
:T:
:n:
“
{2 0} V }
INPUT OBJ
→ →
V T n
«
V
‘
1_m^3
’
*
T
‘
1_K
’
* n
‘
1_mol
’
*
→
V T n
«
V
“
V
”
→
TAG
→
STR
“
”
+ T
“
T
”
→
TAG
→
STR
“
”
+ n
“
n
”
→
TAG
→
STR
“
”
+
‘
(8.31451_J/(K*mol))*(n*T/V)
‘
EVAL
“
p
”
→
TAG
→
STR + + +
MSGBOX
» » »
This new version of the program includes an additional level of sub-
programming (i.e., a third level of program symbols « », and some steps using
lists, i.e.,
V
‘
1_m^3
’
*
{ } +
T
‘
1_K
’
*
+
n
‘
1_mol
’
* + EVAL
→
V T n
The
interpretation
of this piece
of code
is as follows. (We use input string values
of
:V:0.01
,
:T:300
, and
:n:0.8
):
1.
V
: The value of V, as a tagged input (e.g., V:0.01) is
placed in the stack.
Note
: I’ve separated the program arbitrarily into several lines for easy
reading. This is not necessarily the way that the program shows up in the
calculator’s stack. The sequence of commands is correct, however. Also,
recall that the character
does not show in the stack, instead it produces a
new line.
Summary of Contents for 50G
Page 1: ...HP g graphing calculator user s guide H Edition 1 HP part number F2229AA 90006 ...
Page 130: ...Page 2 70 The CMDS CoMmanDS menu activated within the Equation Writer i e O L CMDS ...
Page 206: ...Page 5 29 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Page 257: ...Page 7 20 ...
Page 383: ...Page 11 56 Function KER Function MKISOM ...
Page 715: ...Page 21 68 Whereas using RPL there is no problem when loading this program in algebraic mode ...
Page 858: ...Page L 5 ...