HP Forums
42S/Free42: Using PGMSLV against a program with no VARMENU - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: 42S/Free42: Using PGMSLV against a program with no VARMENU (/thread-11295.html)



42S/Free42: Using PGMSLV against a program with no VARMENU - Dave Britten - 08-30-2018 03:05 PM

This seems to be working fine, but I want to make sure I'm not setting myself up for problems with some unintended consequences.

I'm writing a simple TVM/finance program, and the routine that solves for i% has to do so in an iterative manner. So I created the "I%YR" label that's the entry point for the subroutine to calculate this. This subroutine calls PGMSLV "I%SLV", which is the function being solved. However, unlike with interactively solving a program, I left out any MVAR/VARMENU, since it's not meant to be used interactively, and I don't want it showing up when I invoke the solver. After setting up PGMSLV, the program then recalls "I%YR" (to put a guess in X), and does SOLVE "I%YR".

Like I said, it appears to work totally fine in Free42, and I'm getting correct results, but are there any unintended consequences of doing this? Would there be any problems running such a program on a real 42S?

Here's a really basic and simplified example of the program structure (using a pointless calculation of Log X by solving for Y in 10^Y=X):

Code:
LBL "SLVTEST"
PGMSLV "SLVFN"
RCL "Y"
SOLVE "Y"
RTN
LBL "SLVFN"
RCL "Y"
10^X
RCL- "X"
RTN



RE: 42S/Free42: Using PGMSLV against a program with no VARMENU - Thomas Okken - 08-31-2018 09:24 PM

That usage seems fine. There's certainly nothing in Free42 that would cause problems solving a function without MVARs, and your example works on the HP-42S as well.

It may be significant that when you execute PGMSLV, it offers a menu of all global labels, not just the ones that have MVARs. Smile