HP Forums
cas or home - test in program (userkeys) - 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: cas or home - test in program (userkeys) (/thread-2542.html)



cas or home - test in program (userkeys) - Angus - 12-03-2014 10:08 AM

I have always set home to rpn.
When the calculator is in cas mode Entry still gives 2. How can I check if I am in home or cas mode in a program? I need to distinguish, because user keys have to react in a different way.

Thank you!


RE: cas or home - test in program (userkeys) - DrD - 12-03-2014 11:39 AM

Does this help in any way?

(12-02-2014 10:20 PM)Tim Wessman Wrote:  Use the new #cas #end in a program file. Try to make a "CAS program" from the catalog and you will see the new way to do it. Doing this means that your comments in the CAS functions won't be lost, they can be edited in the conn kit, you can't accidentally delete them and have them permanently gone, and they behave more like the other "program" source files, etc. You can even mix them in with the normal exported function variables.

Basically, anything within #cas #end is executed/parsed by the CAS parser on source compile or check. Thus doing this for example is now perfectly valid:

Code:

#cas
f(x):=x^2;
#end

EXPORT test()
BEGIN
  f(3);
END;



RE: cas or home - test in program (userkeys) - Angus - 12-03-2014 11:53 AM

not really.
I run home im rpn so I have to use a totally different syntax than under textbook or alg. If the pime realized that it is in cas and Entry was different things were easy. But it does not seem to work that way.

The thing is I decided to continue my work on a satifying way to do integer base conversion. I took a look at the poll-site and the desire for a HP42 like, clean and straightforward way to convert bases seems to be rare.


RE: cas or home - test in program (userkeys) - Snorre - 12-04-2014 01:45 PM

Hello,

a (really bad) solution may be
Code:
EXPORT HOMEorCAS()
BEGIN
  IFTE(BITAND(GETPIX_P(23,13),#800000h),"CAS","HOME");
END;
(don't take it too seriously).

Greetings.