HP 50g User Manual Page 683

Graphing calculator.

Example 3 – tagging input and output from function p(V,T)
In this example we modify the program @@@p@@@ so that the output tagged input
values and tagged result. Use ‚@@@p@@@ to recall the contents of the program to
the stack:
"Enter V, T, and n:" {"
«
OBJ
Modify it to read:
"Enter V, T and n: " {"
«
OBJ
V T n
Note: Notice that we have placed the calculation and tagging of the function
p(V,T,n), preceded by a recall of the input variables V T n, into a sub-program
[the sequence of instructions contained within the inner set of program symbols
" ]. This is necessary because without the program symbol separating the
«
two listings of input variables (V T N
the input command
requires six input values, while only three are available. The result would have
been the generation of an error message and the interruption of the program
execution.
To include the subprogram mentioned above in the modified definition of
program @@@p@@@, will require you to use ‚å at the beginning and end of the
sub-program. Because the program symbols occur in pairs, whenever ‚å
is invoked, you will need to erase the closing program symbol (") at the
beginning, and the opening program symbol (
To erase any character while editing the program, place the cursor to the right
of the character to be erased and use the backspace key ƒ.
'(8.31451_J/(K*mol))*(n*T/V)' "
V T n
:V:
V T n '(8.31451_J/(K*mol))*(n*T/V)' EVAL "p"
«
V T N V T n
:V:
:T:
:n:" {2 0} V } INPUT
:T:
:n:"
TAG " "
V T n), the program will assume that
«
) at the end, of the sub-program.
«
{2 0} V } INPUT
Page 21-36  