Programmatic access to app functionality
|
11-02-2015, 06:43 PM
Post: #1
|
|||
|
|||
Programmatic access to app functionality
Greetings,
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 STARTAPP("Statistics_1Var"); STARTVIEW(1); 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, ~Mark Remember kids, "In a democracy, you get the government you deserve." |
|||
11-03-2015, 06:19 AM
Post: #2
|
|||
|
|||
RE: Programmatic access to app functionality
Hello,
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. Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
11-03-2015, 02:09 PM
Post: #3
|
|||
|
|||
RE: Programmatic access to app functionality
(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. -road |
|||
11-03-2015, 03:48 PM
Post: #4
|
|||
|
|||
RE: Programmatic access to app functionality
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, ~Mark Remember kids, "In a democracy, you get the government you deserve." |
|||
11-04-2015, 06:25 AM
Post: #5
|
|||
|
|||
RE: Programmatic access to app functionality
Hello,
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. Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
11-04-2015, 05:14 PM
Post: #6
|
|||
|
|||
RE: Programmatic access to app functionality
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 oldappname.functionname(arglist) 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! ~Mark Remember kids, "In a democracy, you get the government you deserve." |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)