HP Forums
GetFromHome - 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: GetFromHome (/thread-22706.html)



GetFromHome - marcin1812 - 11-15-2024 01:48 PM

Hi,
It’ common knowledge that RPN uses uppercase letters for variables, and CAS uses lowercase.
You can define expressions in RPN, using apostrophes in the first expressions.
Like: ‘(A+B)’
Then You can build expression in classic RPN, for example: 3 X/y – gives: (A+B)^3
etc.
If You wish, and You are RPN Orthodox Wink

But for more advanced expression transformations, You should transfer it to CAS.
Nothing simpler, just press: Menu→Get from Home.

But, there is a primitive failure. Transfer from Home to CAS, doesn’t change uppercase to lowercase.
It’s a shame…

Maybe I’m blind, but I didn’t found any method to automatically changed case.
Strange, that there are no parameters, that define behavior GetFromHome.


So I wrote simple program: Home2Cas:

You Can put its template to User Keys, for example:
KEY K_Home()
BEGIN
RETURN "Home2Cas({""X"",""Y"",""Z"",""A"",""B"",""C""},{x,y,z,a,b,c},"""")";
END;

In the last quotation mark, You should insert Home expression (Menu→Get from home).
And voila Smile

By the way: Some my question:
Is it possible to open menu „Menu->GetFromHome” from PPL?
This would simplify discussed operation.



And here is the code:

EXPORT Home2Cas(Zs,Zd,str1)
BEGIN
LOCAL L,SS,DD,I;

L:=SIZE(Zs);

IF L==0 THEN
str1:=REPLACE(str1,Zs,STRING(Zd));
RETURN CAS.expr(""+CAS(str1)+"");
END;

FOR I FROM 1 TO L DO
SS:=GET(Zs,I);
DD:=GET(Zd,I);
str1:=REPLACE(str1,SS,STRING(DD));
END;
RETURN CAS.expr(""+CAS(str1)+"");
END;


Regards