![]() |
35s prompt for multi-character variables in program like "low footprint" root finder - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: 35s prompt for multi-character variables in program like "low footprint" root finder (/thread-211630.html) |
35s prompt for multi-character variables in program like "low footprint" root finder - Chris C - 02-14-2012 I'm new to the 35s , and loving it, and wanting to learn to use more features. I was looking at programs and found the low footprint root finder (here: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv019.cgi?read=146636 ). It looked great but I couldn't get it to work, so I ended up going with another root finder. The low foot footprint one stuck in my head because of how the writer prompted for variables using multiple characters, which would help make sure the correct value was entered in the correct place in an equation. (He prompted for X1 and X2 and Y1 and Y2.) I tried to figure out the low footprint code, but I never could, so that's why I'm starting this thread. I'd like to be able have this functionality for a class where there are dozens of equations, and I need to make sure I enter the correct variable values in the correct places. So, question (a): The author says he uses unnamed indirect variable addresses. Is doing this necessary to be able to use multiple characters to prompt for variables? (I don't store variable values in the A-Z spaces, so I don't need to preserve anything in those spaces.) Question (b): How do I do this as simply as possible for programming and usage?
Thank you all,
Edited: 14 Feb 2012, 11:24 a.m. after one or more responses were posted
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Bart (UK) - 02-14-2012
Quote:No. Quote:that is correct. If you are not concerned with preserving the contents of the named A-Z variables (or actually want to use them), you can use e.g. "STO A" instead of "STO (I)". The other post is using the "message" function of the 35s to prompt for variables, load them on the stack and then stores them. The INPUT does it all in one step, but with the limits of single letter variables. See page 13-16 in the manual, section "Using Equations to Display Messages". Also see this thread: HP-35s messages Regards, Bart Edited: 14 Feb 2012, 11:19 a.m.
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Chris C - 02-14-2012 Thanks Bart. I've read and read in the manual and tried things but haven't been able to put it together into what I need. I do understand how to use flag 10 and show the multi-character prompts on screen. I just don't understand how the calculator treats the entries entered after the prompts. If you, or someone, wouldn't mind, could you post code for a small sample program so I could learn from it and apply it to my other needs? NC=(H1-H2A)/(H1-H2S) Thank you!
Edited: 14 Feb 2012, 12:13 p.m.
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Bart (UK) - 02-14-2012 As I mentioned, the "low footprint" program first loads variable values onto the stack, then stores them. LABEL STEP COMMENT You will see the answer in the X-register (bottom line), and the values of the entered variables above. If you want a "clean" display showing zero's and the answer, then do a "clear stack" before executing the formula: LABEL STEP COMMENT Regards Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Alexander Oestert - 02-14-2012 LBL A SF 10 (Set message mode) KEY IN VALUE (the message) CF 10 (End of message mode) STO A (store in A whatever was keyed in during message was shown and after R/S was pressed in Run mode) VIEW A
RTN
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Chris C - 02-14-2012 Thanks very much. This looks like just what I was hoping for. One question on something you said though. When you said: "...the stack is only 4 levels, you can only do 4 variable values in one go." are you meaning this is applies if using unnamed indirect variable addressing or does it apply to your example too? Can't your example below use up to 26 variables (A-Z)? Or am I misunderstanding? What if the variable values were entered one at a time? Like:
A003 ENTER H1 Edited: 14 Feb 2012, 6:59 p.m.
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Chris C - 02-14-2012 Thank you.
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Bart (UK) - 02-14-2012 I was referring to the number of variable values that could be handled in one line, as in my A003. You can still do 261, but just 4 at a time.
Edited: 14 Feb 2012, 7:52 p.m.
Re: 35s prompt for multi-character variables in program like "low footprint" root finder - Chris C - 02-14-2012 I understand. Thanks very much!
|