Post Reply 
Help with a program, getting Ans to get info from CAS not Home.
06-25-2021, 08:26 AM
Post: #1
Help with a program, getting Ans to get info from CAS not Home.
I have been trying to make a program to leave the leading zeroes on a number, just to get a quick look at them, and experiment with the calculator.

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.

It seems that at the first reference to Ans() is being taken from Home mode, not CAS, and the second use of Ans() is being taken from CAS. So, if the number in history in home screen, and CAS are of the same order, then it actually works fine. It is degigned to read the last 2 digits of a number in memory, like 2.36E-25, it would read only the 25 and then store that as a string in g and a number in i.

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

Code:
EXPORT CDEC()
BEGIN
LOCAL f:=STRING(Ans(1));
LOCAL g:="";
LOCAL h:="";
LOCAL i:=0;
g:=RIGHT(f,2);
i:=EXPR(g);
i:=i+2;
h:="f"+STRING(i);
MSGBOX(format(Ans(1),h));
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help with a program, getting Ans to get info from CAS not Home. - matalog - 06-25-2021 08:26 AM



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