newRPL: Alpha demo 0.9 released [UPDATED 2017-10-25]
|
08-14-2017, 02:26 AM
Post: #11
|
|||
|
|||
RE: newRPL: Alpha demo 0.9 released [UPDATED 2017-08-11]
(08-14-2017 12:47 AM)smartin Wrote: Just a few comments/questions on the new commands.Confirmed. Will upload an updated ROM in a couple of days, thanks for the report. (08-14-2017 12:47 AM)smartin Wrote: What does NPOS/NPOSREV do?Same thing, but starting the search from given position N instead of the beginning. If POS returns position 'p', just pass 'p+1' to NPOS to find the next ocurrence. (08-14-2017 12:47 AM)smartin Wrote: SPUSH, SPOP, SDROP - Nothing seems to happen when I try and use these. I was expecting that SPOP after doing an SPUSH would restore the previous stack contents. They work as intended. You need to consider that they do the same as the automatic UNDO feature. So if you run SPUSH from the menu, the only effect you'll notice when you press the left cursor to UNDO, you'll have to press it twice, as there will be 2 identical copies of the stack, one made automatically when you pressed the menu, and the second one done by SPUSH. When you run SPOP from the menu, it pops the UNDO information that's created automatically when you pressed the menu, so you'll notice if you change the stack and then press left, the previous stack won't be there. To see the real effect, it's best to use them in a program: Code:
Code:
The idea is you can SPUSH the original stack state, then explode a list or something like that, and if you encounter an error, you can trap it and do an SPOP before ending your code with a DOERR or BLAMEERR. It makes for a much cleaner exit on complex programs. BTW, I added how to use SETNFMT in the "Formatting Numbers" section to the wiki, that's one of the new features that needs testing too, please test. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)