HP Forums
HP PPL How to pick a CAS expression off the stack? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: HP PPL How to pick a CAS expression off the stack? (/thread-25.html)



HP PPL How to pick a CAS expression off the stack? - Chris Pem10 - 12-11-2013 06:53 PM

Suppose I have the following three CAS results on the right hand side of the "stack":

SIN(x)
COS(x)
TAN(x)

From within a program, I'd like to store expression SIN(x) in a variable eq1, skip the COS(x) expression, and store expression TAN(x) in variable eq2. This was simple in previous RPN calcs, but I'm not sure how to do this in the Prime?

Code:

EXPORT READ_FROM_STACK()
  LOCAL eq1, eq2;
  code to pick expressions off the stack....
END;

I was looking for something in the spirit of:

Code:

sto(Ans(1),eq1);

but I haven't had any success yet.


RE: HP PPL How to pick a CAS expression off the stack? - Han - 12-11-2013 07:34 PM

RPN is currently not implemented for CAS view nor is it supported in programming (at the moment).


RE: HP PPL How to pick a CAS expression off the stack? - Chris Pem10 - 12-11-2013 08:06 PM

I am aware that RPN is not available for this task... if it were, I'd be in familiar waters. But certainly there must be a way to access the expressions on screen? If it's sitting there, it must be stored somewhere. I don't want to resort to manually storing each expression in a variable prior to running the program...


RE: HP PPL How to pick a CAS expression off the stack? - Joe Horn - 12-12-2013 02:49 AM

Prime has three distinct onscreen stacks:

1. Textbook/Algebraic history stack
2. RPN stack
3. CAS history stack

Which one do you want to access in your programs?

-Joe-


RE: HP PPL How to pick a CAS expression off the stack? - Chris Pem10 - 12-12-2013 04:18 AM

I would like to access the CAS history. I believe the Textbook/Algebraic stack is already well documented.

Thanks


RE: HP PPL How to pick a CAS expression off the stack? - cyrille de brébisson - 12-12-2013 03:43 PM

Hello,

Sorry, no ways that I know of.
Maybe bernard has a trick to do that...

cyrille