HP Forums

Full Version: Programmatic access to app functionality
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I'm trying to determine if I can access the functionality of one app from a program written for a user created app. As an example of what I'd like to do, I'd like to create my own app based on the Spreadsheet app, then invoke the plot capabilities of the Statistics 1Var app.

About as far as I've been able to get is to set up the data and configuration in the Statistics app using the appname.variablename convention. If I then override the Plot button and have the Plot() function call


I get the plot screen I hoped for. Unfortunately, I'm now in the Statistics app instead of my custom app!

Is there any way to get the equivalent of the STARTVIEW command for an app other than the current app or an alternate means of invoking the functionality of another app?

Many thanks,

To do this, normally, you would base your custom app on the stat 1 var app...

Of course, if your aim is to create a program that uses the functionality of multiples apps, then I am sorry, but what you are doing is pretty much the only solution.

(11-02-2015 06:43 PM)mfleming Wrote: [ -> ]I get the plot screen I hoped for. Unfortunately, I'm now in the Statistics app instead of my custom app!

I recently had a similar dilemma. The solution was to create two custom apps, one based on the spreadsheet app and one based on the statistics app. You can override the Plot button in one app and the Num button in the other app to switch between the two. It’s kind of a roundabout way of doing things, but it gets the job done.

Thank you roadrunner, that sounds like a reasonable solution to my problem. I would certainly rather create a composition of applications, rather than (re)implementing some application functionality from scratch.

Perhaps my mental model of apps as classes, saved apps as instances and key redefinitions as method overload is faulty. Is there a document or thread someone would recommend that provides a clear understanding of an app and its environment?

Many thanks,

Your "mental image" is actually pretty darn good, I never thought about it like that, but it is a quite good analogy...

I think that the only place where this analogy does not match the usage model that we envision is in the fact that your application needs more than one class.
Not that we never thought of that scenario, but we always kind of assumed that this would be a very infrequent scenario.

Hi Cyrille,

Thanks for the information. The class model was one of the HP Prime features that I thought was pretty innovative. Being able to add exported functions to the program associated with a user app, and being able to override default app key behavior did seem a lot like creating a subclass.

Playing around with the subclass idea, I've found that saving a user app also copies its user program file to the new app program file. Replacing the code in the new app function bodies with a super reference


works as well. Seems like a germ of an idea to support method references in a class hierarchy.

Based on roadrunner's solution to the multi-app question I had, it sounds like the Prime can be said to have something like an Active Object model with a single thread of control. I'll have to explore this a bit more, but if each app object maintains its own computational context, cooperating active objects could be a pretty powerful "mental image" for creating app solutions.

Very interesting functionality indeed!
Reference URL's