Post Reply 
HP42s – Solver / Variable Menu compatibility.
04-19-2016, 01:03 PM
Post: #1
HP42s – Solver / Variable Menu compatibility.
I have successfully called the Solver application from within a program that uses the MENU function, however it would be better if I could call the Solver from a program that uses the VARMENU function.

Is it possible to call the Solver from a program that is using the VARMENU function? The calling program is required to declare the variables for the menu in the first lines of the program. Conflicting with this is the need to declare the program being called by the SOLVE function by using the PGMSLV function as the first line in the calling program.

Is there a way to incorporate a call to Solver from a program using VARMENU?
Find all posts by this user
Quote this message in a reply
04-19-2016, 01:25 PM
Post: #2
RE: HP42s – Solver / Variable Menu compatibility.
Welcome to our forum!

I have n access to my HP-42S at the moment.

Did you had a look into the MoHPC archived posts?
Some posts that may help:
42S: use of VARMENU
Programming HP-42S
Perhaps using SOLVE... (look for message #7)
Hp 42s Equation problem
HP-42S/41 programming info

The above links were found by typing this in the Google interface:
hp-42s varmenu site:www.hpmuseum.org

Jose Mesquita
RadioMuseum.org member

Find all posts by this user
Quote this message in a reply
04-19-2016, 01:44 PM
Post: #3
RE: HP42s – Solver / Variable Menu compatibility.
This seems to work, at least according to Free42.

Code:
LBL "VOL"
MVAR "L"
MVAR "W"
MVAR "H"
MVAR "V"
RCL "L"
RCL* "W"
RCL* "H"
RCL- "V"
END

LBL "BOXSLV"
MVAR "L"
VARMENU "BOXSLV"
STOP
PGMSLV "VOL"
RCL "L"
3
*
STO "H"
3
*
STO "V"
SOLVE "W"
END

XEQ "BOXSLV", supply a value for L using the menu, and press R/S.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-19-2016, 02:30 PM
Post: #4
RE: HP42s – Solver / Variable Menu compatibility.
(04-19-2016 02:09 PM)Mike (Stgt) Wrote:  
(04-19-2016 01:25 PM)jebem Wrote:  I have no access to my HP-42S at the moment.

No excuse, just use another one like this one or this alternative choice (which also works w/o further ado as a portable application).

Ciao.....Mike

I am well aware of those options.
Helping others with related information to the raised question that is available here in the archives was my goal to the newcomer.

Jose Mesquita
RadioMuseum.org member

Find all posts by this user
Quote this message in a reply
04-19-2016, 02:37 PM
Post: #5
RE: HP42s – Solver / Variable Menu compatibility.
Many thanks for your replies jebem and Dave.

I entered Dave’s code into free42 and it worked. I will now dissect my code to see just where and why it is falling over. I should have started out with a smaller program fragment and only built it up once the control structure was proven.
Find all posts by this user
Quote this message in a reply
04-19-2016, 02:44 PM
Post: #6
RE: HP42s – Solver / Variable Menu compatibility.
(04-19-2016 02:37 PM)Timbergetter Wrote:  Many thanks for your replies jebem and Dave.

I entered Dave’s code into free42 and it worked. I will now dissect my code to see just where and why it is falling over. I should have started out with a smaller program fragment and only built it up once the control structure was proven.

Totally wild guess: I'd wager that the program has to run uninterrupted between the time you call PGMSLV and SOLVE.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-20-2016, 04:03 AM
Post: #7
RE: HP42s – Solver / Variable Menu compatibility.
Thanks everyone for your help. I now see the errors of my ways. My assumptions in my first post were quite wrong. The global label that VARMENU references can be anywhere in a program or somewhere within another program unit. The related MVAR declarations must follow on from that global label. The PGMSLV function/declaration need not be the first line in the program after the label. The DPLOT program on page 156 of the Owner’s Manual is a valuable resource in sorting out the use of VARMENU.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)