42S/Free42: Using PGMSLV against a program with no VARMENU
08-30-2018, 03:05 PM
Post: #1
 Dave Britten Senior Member Posts: 1,567 Joined: Dec 2013
42S/Free42: Using PGMSLV against a program with no VARMENU
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
08-31-2018, 09:24 PM
Post: #2
 Thomas Okken Senior Member Posts: 1,058 Joined: Feb 2014
RE: 42S/Free42: Using PGMSLV against a program with no VARMENU
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.
 « Next Oldest | Next Newest »

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