A couple of RPL questions - 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: A couple of RPL questions (/thread-138499.html) |
A couple of RPL questions - Hal Bitton in Boise - 06-28-2008 Hi folks,
2. Can I force a display update during program execution without pausing? Re: A couple of RPL questions - Allen - 06-28-2008
Quote:Generally speaking you can either leave the number on the stack or depending on what the stack traffic and DEPTH is like during the loop, it may be easier to save to a local or global variable. If the number is on the stack, the addressing mode varies according to depth. If you know it is always at stack position P you can grab a copy by using P ROLL and put it back by P ROLLD. There are easier, faster ways if you know the stack depth of the counter, and especially when the depth is 3 or less. The WHILE/REPEAT loops may also help. If you have a partial program, perhaps there is more to say. Are you optimizing for speed or size?
Edited: 28 June 2008, 8:34 p.m.
Re: A couple of RPL questions - Hal Bitton in Boise - 06-29-2008 Hi Allen, thanks for your response.
I will only be using what's in stack level 1 in my do until loop, adding 1 to it and comparing it to 50, so the construct would look like this:
Re: A couple of RPL questions - Raymond Del Tondo - 06-29-2008 Hi,
it seems there is some misunderstanding on how an RPL data stack works.
Please take a look at an appriorate RPL tutorial,
For the 2nd question:
I assume you actually want to show the contents of the data stack, Alternatively you could call some suitable SysRPL entries to do that work;-)
Raymond
Re: A couple of RPL questions - Egan Ford - 06-29-2008 Quote:A couple of issues. Comparison operators pop two values off the stack and comparison operators should be postfix. Type in your 48/49/50: 1 2 >Your calc will return '0' to the stack, and the 1 and 2 will be removed from the stack. Reverse the 1 and 2 and '1' will be returned. The return value of '0' or '1' is used by UNTIL (also popped).
Your counting program should look like: DOor DOI prefer the later, i.e. keeping it all postfix just like FORTH: BEGIN Edited: 29 June 2008, 1:34 p.m.
Re: A couple of RPL questions - Allen - 06-29-2008
Quote:
I recommend reading Chapter20 RPLMAN (from hpcalc.org). FWIW, I agree with egan regarding the syntax for your loop:
DO but if this is all you are doing, it is better just to use
1 WAIT
If there are actual inputs and outputs to your loop (other than the counter), There is almost certainly a better way.
Re: A couple of RPL questions - Reth - 06-30-2008 I'd suggest you to read the manuals before asking here for help. If someone can not figure out how DO UNTIL works and calls it function any help is pouring water in sand
Re: A couple of RPL questions - Hal Bitton in Boise - 06-30-2008 Hello Reth Quote:Agreed. I have read the manuals (48g and 50g guides). I was seeking help on two specific tecniques which were not forthcoming from the documentation. Egan Ford, and Allen were both kind enough to offer very good insight, all delivered within a few lines. How would this possibly supplant reading the manual?
Quote:I'm assuming that you are basing this assessment on the fact that I called DO UNTIL a function, whereas "loop construct" would have been more appropriate. I'm going to give you the benifit of the doubt on this point, that you're not trying to insult my intelligence. The aforementioned help which I recieved was put to good use, and has resolved the issue I was having. This was most certainly NOT analagous to pouring water onto sand. I think that in the future I will continue to ask for a bit of help from time to time, in spite of the possibility of being rebuked by you. Best regards, Hal Re: A couple of RPL questions - Jeff Kearns - 06-30-2008 I am a regular visitor to the forum but an infrequent contributor. I nonetheless find your questions and comments to be appropriate and I have always found them to be worthy of asking those on this forum who may know a bit more about RPL programming than the average user. I am a RPL beginner myself and learn a great deal from the Q&A strings. Good response. Jeff Kearns
Re: A couple of RPL questions - Reth - 07-01-2008 I'm sorry, Hal, I didn't want to be abusive, I only remembered how I myself worked it out some 20 years ago (it was the HP28s) having only german language manual and not understanding a word, only figured it out by the examples given and coming from the HP41 experience; Back then I was so much in love with those calculators so I started understanding foreign languages ;) Re: A couple of RPL questions - Hal Bitton in Boise - 07-01-2008 Thank you Reth... |