Post Reply 
Help with a program, getting Ans to get info from CAS not Home.
06-25-2021, 09:39 AM
Post: #2
RE: Help with a program, getting Ans to get info from CAS not Home.
(06-25-2021 08:26 AM)matalog Wrote:  I told the Prime I was setting up a NEW program with CAS activated, so I assumed it would read from the CAS Ans() history.

Well, your program is a PPL program, not a CAS program which should start with #cas and has a different syntax for the declaration of the program name.

I recommend the reading of the HP-Prime: Documentation & Tutorials on this forum as you'll find a lot of information not available in the Prime manual, including for CAS programs: HP Prime CAS programming

(06-25-2021 08:26 AM)matalog Wrote:  Can anyone offer any guidance as to how I can get it to correctly use the number in the CAS history, to set the length

You may read this thread about the difference between the Home Ans and the CAS Ans.

To ensure you access the CAS Ans you can use CAS.Ans instead of Ans(1) in your program.

But if you want to access either the Home Ans or the CAS Ans depending from where you are running your program you need a way to know if you launched your program from Home or from CAS. I'm not aware of a clean way to get this information in a PPL program.
Here is how I've implemented this in Base48 and Units48 by checking the CAS indicator on the screen as a workaround:
Code:
CASMode()
BEGIN
 GETPIX_P(16,10)==#FFFFFFh;
END;
[...]
a:= IFTE(CASMode(), CAS.Ans, Ans); // IF CAS, then import CAS.Ans, else Home Ans
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Help with a program, getting Ans to get info from CAS not Home. - Didier Lachieze - 06-25-2021 09:39 AM



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