Post Reply 
how to know if prog was started from home or cas ?
03-05-2018, 04:56 PM (This post was last modified: 03-05-2018 04:58 PM by primer.)
Post: #7
RE: how to know if prog was started from home or cas ?
(03-05-2018 05:54 AM)toshk Wrote:  i think the easy way is to pick the different behaviors in results of a common function under CAS and Home;
eg;
Home;
TYPE(coeff("y","y"))==4;
CAS
TYPE(coeff("y","y"))==6;
and set Flag accordingly;

sorry it does not work in a program context.
for example :

Code:

KEY KS_Abc()
BEGIN
local a:=TYPE(coeff("y","y"));
IF a==4 THEN 
 MSGBOX("from Home");
ELSE
 MSGBOX("from CAS");
END;
END;
Will always popup "from Home" (press [shift]+[a b/c])
because the program itself run from the Home language...

I think we really need to have few flags to know the context of program run.
I even don't ask to interact with that context (...it could be next step) but at least to know :
  • Do I run from Home or CAS context ? (important to know if I must use Ans or CAS.Ans)
  • Does the user was in entry mode or Not ? entry mode = edit line were open (important in the scope of user Key too)
These two are important to deal with user keys properly.
Thanks.
Fabien.

primer
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: how to know if prog was started from home or cas ? - primer - 03-05-2018 04:56 PM



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