The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
GetFromHome
11-15-2024, 01:48 PM
Post: #1
GetFromHome
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
GetFromHome - marcin1812 - 11-15-2024 01:48 PM



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