The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

42S: use of VARMENU ?
Message #1 Posted by Curtis Cameron on 6 Nov 2006, 6:22 p.m.

I'm trying to figure out the programming of a 42S, especially the solver. I am a native 41C speaker.

I see that the solver can use the MVAR command, which I understand, but one program I found has the VARMENU command, but I can't tell what it does. I guess it goes without saying that I don't have the manual.

Also, is there a simple way to have a solver program to show the same basic value of something in three (or more) different units? A simple example would be meters, feet, and miles. I'd like to use the solver to have three menu items, and could enter '1000', hit M, then hit FT and have it give me the value 3.3, then hit MI and have it give me the value 0.001 (or whatever). I know that the solver on my 200LX has the S() function, which you can test which variable you're solving for. Any equivalent?

thanks

      
Re: 42S: use of VARMENU ? (edited after Karl's post)
Message #2 Posted by Vieira, Luiz C. (Brazil) on 6 Nov 2006, 11:29 p.m.,
in response to message #1 by Curtis Cameron

Hi, Curtis;

VARMENU works together with a MVAR "variable_name" sequence. Once you define the MVAR (Menu VARiables) with a MVAR sequence, VARMENU actually creates a VARiable MENU that contains the many MVAR variables. Consider that MVAR 'declares' the variables that will be used in the progrma. An important notice: the MVAR 'declaration' sequence must be the first thing after the first glogal label in the program (I am not sure if you can have spare lines before the first global label in this case...). Consider the following sequence:

LBL "TST"
MVAR "V01"
MVAR "V02"
MVAR "V03"
VARMENU  (after Karl's post, I realised I missed the "TST" here)
STOP
(remaining program lines)
After runing this program, a menu containing three custom labels is shown. You can key in each of their values and press the corresponding menu key, than you press R/S so the program resumes. It is a common procedure to add an EXITALL after the STOP in order to 'close' the variables menu created by VARMENU so the display returns to regular stack presentation. (p.125 of the Brazilian HP42S User's Manual)

Hope this helps.

Luiz (Brazil)

Edited: 7 Nov 2006, 12:20 a.m.

            
Re: 42S: use of VARMENU ? (edited after Karl's post)
Message #3 Posted by Thomas Okken on 7 Nov 2006, 10:06 a.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

You can key in each of their values and press the corresponding menu key, than you press R/S so the program resumes.

When you press two menu keys in sequence, the program also resumes; the name of the second menu key is stored in the ALPHA register.
You can use this behavior to emulate the behavior of the solver, for instance. To see a practical example, take a look at my version of the DPLOT program (at http://home.planet.nl/~demun000/thomas_projects/free42/42progs/).
Also, the HP-42S manual and the Programming Examples & Techniques book document these advanced programming constructs very well (the PE&T book has very elaborate examples, but the manual is pretty good all by itself). If you really want to get into this, getting the HP Museum CD/DVD is money well spent.

- Thomas

                  
Re: 42S: use of VARMENU ? (edited after Karl's post)
Message #4 Posted by Vieira, Luiz C. (Brazil) on 8 Nov 2006, 10:46 p.m.,
in response to message #3 by Thomas Okken

Hi, Thomas;

thank you for pointing this feature out. I must confess I do not remember reading about it, neither have used the variables menu this way. Always learning a bit more... 8^)

And about the HP42S PE&T (fancy!), I am one of the lucky ones who got the chance to buy an original print from Good-old-days EduCalc, along with a (small) bunch of other good books: Wickes "HP48 Insights", V1 and V2 (S-series only), Mathews & Eidswick's 'HP48G Calculus Companion' (good stuff!), Grapevine's 'An Easy Course in Using the HP42S' (and the HP48 related title), and a few others. I keep these in the best shape possible, but I like to have a look at them one time and another. Not so very often, as you see...

Cheers and thanks again.

Luiz (Brazil)

Edited: 8 Nov 2006, 11:23 p.m.

      
Re: 42S: use of VARMENU ?
Message #5 Posted by Karl Schneider on 6 Nov 2006, 11:56 p.m.,
in response to message #1 by Curtis Cameron

Greetings, Curtis --

Quote:
I see that the solver can use the MVAR command, which I understand, but one program I found has the VARMENU command, but I can't tell what it does. I guess it goes without saying that I don't have the manual.

VARMENU "PROG" displays a menu of variables defined with MVAR immediately following the external label "PROG". (The SOLVE and INTEG functions essentially do an automatic VARMENU.)

Quote:
Also, is there a simple way to have a solver program to show the same basic value of something in three (or more) different units?

Hmm, it becomes difficult using an equation of three or more variables when solving for one variable based on another, because all the "uninvolved" variables would need to be zeroed out. I don't see a simple solution.

In addition to VARMENU, there is also the Programmable Menu, described on pp. 145-148 of the HP-42S Owner's Manual (a scan of which can be purchased for a nominal price on CD or DVD from the MoHPC website).

I've written an application program for the HP-42S that utilizes both VARMENU and the Programmable Menu. I use the program occasionally, but don't plan to distribute it. The application program is just too complicated, not fully intuitive, and hard to document. There are better platforms for such an application than the HP-42S.

-- KS

Edited: 7 Nov 2006, 12:02 a.m.

            
Re: 42S: use of VARMENU ?
Message #6 Posted by Curtis Cameron on 7 Nov 2006, 9:44 a.m.,
in response to message #5 by Karl Schneider

Thanks, guys. What I think I was missing, is that I was accessing my program from the Solver anyway, so I don't think the VARMENU command does anything in that case. Sounds like it is useful if you're wanting the Solver functionality but have run the program as an ordinary program.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall