From: jhmeyers@miu.edu (John H Meyers)
Subject: Calling a triangle solver (in User-RPL)
Date: 07 Jun 1998 00:00:00 GMT
Message-ID: <6legh2$ntj$1@news.iastate.edu>
References: <6lbgm9$89r$1@newsfep2.sprintmail.com>,<1998060704410600.AAA00872@ladder01.news.aol.com>,<6lddvo$kdm$1@news.iastate.edu>,<6le2s1$l27$2@news.iastate.edu>
Reply-To: jhmeyers@miu.edu
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Newsgroups: comp.sys.hp48


Should you wish to call the previously posted TRI1 User-RPL program
from other programs, in order to solve triangles as a
subroutine of other computations, here's how:

   3 'a' TRI1  @ Store  3 as side 'a'
   4 'b' TRI1  @ Store  4 as side 'b'
  90 'C' TRI1  @ Store 90 [in current angle mode] as angle 'C'

Or: { 3 4 90 } { a b C } 2 \<< TRI1 \>> DOLIST EVAL

When the necessary three values have been supplied,
the triangle will be automatically solved, and the six values,
in the order { a b c A B C }, will be returned in a list.

You can also do:

  'a' DUP TRI1 @ Recall current value of side 'a', etc.

The supplied (and calculated) values are internally retained,
until you perform { PURGE } TRI1 to purge them.

Although TRI1 includes a TMENU command, to display a menu
after all programs stop running, you can override it via
RCLMENU ... (call TRI as desired) ... TMENU
(supplying the original result of RCLMENU back to TMENU),
or, you can set any specific menu number, e.g 2 MENU (VAR).

Alternatively, you can remove the TMENU command from TRI1,
and save it in a separate program, so that TRI1 will only
do computations, while the menu command can be used just
once, to set up the manual menu only when you want to use it;
the internal display routine (showing all current values on screen
each time TRI1 is called) can also be made separate, if desired.

If you remove the two words #64037h SYSEVAL from the TRI1 program,
then the variables { a b c A B C } will be stored in the current
directory, instead of in the "hidden" directory; this could give you
an even more direct way to supply the input values and retrieve the
output values, if you'd rather do it this way; the standard VIEW key
(with the VAR menu) could then be used to view all results at once.

It is thus easier to make any desired adaptations to User-RPL programs
than to libraries, partially compensating for some of the other
advantages enjoyed by libraries.

"User-RPL is not a dead language!"  :)

"Don't count LBJ out on Viet and Election"
- Headline of the very first edition of the "New York Daily Column,"
  which hit the streets with a thud on April 1, 1968(?), only hours
  after Lyndon B Johnson had just told the world that he would not run :)

 Speaking of which, I just heard "Clean [Eu]Gene [McCarthy]" the other day
 on a radio call-in program; live history is better than textbooks, folks!

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>
