Post Reply 
Getting the most from the stack.
05-16-2021, 06:05 AM
Post: #2
RE: Getting the most from the stack.
(05-15-2021 08:44 PM)matalog Wrote:  [...]
I have read that the HP Prime has a fixed stack, with 128 results.

Is there any conceivable way for me to increase that with a program or some advanced method?

Is there a way for me to set the calculator to automatically save the stack to a file, after 128 calculations?
[...]

Can anyone think of any way to achieve something like this?


Not automatically, but this code allows the stack to be saved to a note and recalled using a user defined key:

Code:

EXPORT stack2note(x)
BEGIN
LOCAL stack1:="";
2▶Entry; //set entry mode to RPN
REPEAT 
stack1+Ans(x)+" "▶stack1;
x-1▶x;
UNTIL x==0;
stack1▶Notes("stk");
END;

KEY K_5
BEGIN
LOCAL stack1:="";
2▶Entry;
Notes("stk")▶stack1;
RETURN stack1;
END;

I haven't refined it, but it's enough to show the concept.
Set up desired stack levels in rpn mode, then to avoid disturbing the stack, switch to ALG mode and enter stack2note(n) where n is the desired number of stack levels to save. The program switches to RPN mode and saves the stack levels to Notes("stk"). There must be at least as many stack levels defined as n.

This will save a note called "stk" which contains your stack levels.
(Shift Notes will allow you to examine the note - it contains the stack levels sequentially)

To recall the stack, Shift User 5 will read the contents of Notes("stk") to the RPN command line. Pressing Enter will restore the stack levels.

You may be able to adapt this method to suit your needs?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Getting the most from the stack. - matalog - 05-15-2021, 08:44 PM
RE: Getting the most from the stack. - Stevetuc - 05-16-2021 06:05 AM



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