HP Forums
How to make cas-mode program visible when choosing from program library - 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: How to make cas-mode program visible when choosing from program library (/thread-13318.html)



How to make cas-mode program visible when choosing from program library - teerasak - 07-23-2019 03:49 AM

I'm creating a program in cas mode with (when creating a program, I checked on cas check box). Then I work in cas mode. When accessing the program, I press program library button (which is mem key) > User

ิI can't find the program I wrote. I found only the program I wrote which are not in cas mode.

How can I make my program in cas mode visible from User list.

Note : I can find it in Catlg.


RE: How to make cas-mode program visible when choosing from program library - cyrille de brébisson - 07-23-2019 05:53 AM

Hello,

The way CAS works makes it difficult to find programs... in a list...
Furthermore, most programs have sub functions, and in the CAS, there is no way to distinguish main program entry from sub functions...

The best solution (should your program allow it), would be to write a PPL "header" for your cas program and set that "header" or "calling function" as exported.

cyrille


RE: How to make cas-mode program visible when choosing from program library - teerasak - 07-26-2019 04:22 AM

Thank you, Cyrille for your help.

I'm quite new to HP Prime programming. Not get what you try to explain.

Let's say, my program written in cas mode is like this:

#cas
Test123(AB,CD):=
BEGIN
RETURN AB*CD;
END;
#end


what should I do (or added in the code) to make the program visible in the list


RE: How to make cas-mode program visible when choosing from program library - Tim Wessman - 07-26-2019 04:42 AM

It is visible, under "VARS->Cas->Program"

The problem is that cas "programs" are actually variables containing an object that happens to contain something that executes. You can delete it, store something else in it, etc. It really is just a variable.

There is no difference unfortunately between f(x):=x^2 and something much more complicated. Would you want f(x)=x^2 to appear in your "programs" area?


RE: How to make cas-mode program visible when choosing from program library - Han - 07-26-2019 06:01 AM

Just create a wrapper as suggested by Cyrille. Create your CAS program with using whatever program name you want and just add an 'h' in front for a HOME program that calls your CAS program. Example:

Code:
#cas
BEGIN CASPRG():=
  return(2-1);
END;
#end;


EXPORT hCASPRG()
BEGIN
  CASPRG();
END;



RE: How to make cas-mode program visible when choosing from program library - victorvbc - 07-26-2019 05:53 PM

I like setting up my own pop-up program menu, assigned to a user key. Here's an example from Eddie's blog that does exactly that:

http://edspi31415.blogspot.com/2017/11/hp-prime-user-key-building-list-of.html

-Victor