06-24-2021, 10:56 PM
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 have got this far, and 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.
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
I have got this far, and 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.
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;