Post Reply 
Creating a custom app with multicharacter variables AND pre-populating E1 equation?
04-18-2021, 02:54 AM
Post: #1
Creating a custom app with multicharacter variables AND pre-populating E1 equation?
Hello all,

I have been fiddling around with making custom apps (based on the Solver app, in my case). I have managed to figure out how to use the EXPORT command at the beginning of the Program section to create the variable names I want to use, but I can't figure out how to get the equation populated in the "E1" field on the Symbolic tab of the application when I am using the HP Connectivity Kit.

The export line looks like this:
EXPORT Total,q,Tr,Ts1,Ts2;
The equation I try to enter in the E1 field is:
Total=(48/(12*(q-1)+(12-Tr)))*(Ts1+Ts2)

When I type the above into the E1 field and press enter, the text disappears, and I see a warning on the bottom corner of the app window saying Syntax Error.

Is this simply not possible when using non-standard variables that are created in the Program?

I can put the same equation in the E1 field of the custom solver app when it is running, and it all works in the simulator, but I would like to "hard code" it into the app to keep it from getting inadvertently deleted or cleared. As an example, if I edit anything on the Info tab (some notes), and save, the E1 field gets cleared.
Find all posts by this user
Quote this message in a reply
04-18-2021, 04:45 AM (This post was last modified: 04-18-2021 04:49 AM by Han.)
Post: #2
RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation?
(04-18-2021 02:54 AM)spiff72 Wrote:  Hello all,

I have been fiddling around with making custom apps (based on the Solver app, in my case). I have managed to figure out how to use the EXPORT command at the beginning of the Program section to create the variable names I want to use, but I can't figure out how to get the equation populated in the "E1" field on the Symbolic tab of the application when I am using the HP Connectivity Kit.

The export line looks like this:
EXPORT Total,q,Tr,Ts1,Ts2;
The equation I try to enter in the E1 field is:
Total=(48/(12*(q-1)+(12-Tr)))*(Ts1+Ts2)

When I type the above into the E1 field and press enter, the text disappears, and I see a warning on the bottom corner of the app window saying Syntax Error.

Is this simply not possible when using non-standard variables that are created in the Program?

I can put the same equation in the E1 field of the custom solver app when it is running, and it all works in the simulator, but I would like to "hard code" it into the app to keep it from getting inadvertently deleted or cleared. As an example, if I edit anything on the Info tab (some notes), and save, the E1 field gets cleared.

You can use strings. Solvesys aka Equation Library uses this to populate the entire Symb view, and even incorporates "pages" of equations when more than 10 are needed. The source is included with the download. Feel free to insert DEBUG commands to step through the app.

Anyway, a direct example within a program would be: E0:="X^2"

Some caveats -- always ensure that the variables you use already exist. Either create app variables, or define them in your source code. Otherwise when the user enters the Symb view they will see error messages. Lastly, the code must not exist as a program. In fact, you'll need to make a copy of the Solve app. Then, edit the copied app's source file and create your program from there. There might be others that I may have overlooked, but hopefully that is enough to get you started.

EDIT: Here's an older thread (for apps based on the Function app, but still relevant) that you might find helpful: https://www.hpmuseum.org/forum/thread-2167.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-18-2021, 06:08 AM
Post: #3
RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation?
Thanks for the feedback! I will check those out tomorrow.

But based on your statement of using strings, could I just copy the equation from my post directly into the E1 field in the app editor (from the connectivity kit) surrounded by double quotes, or is that only applicable for programmatically populating them?

I tried it with no quotes and with single quotes earlier but never tried doubles...
Find all posts by this user
Quote this message in a reply
04-19-2021, 02:56 PM
Post: #4
RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation?
Hello,

For what you are trying to do, I would do the following:

use this as your app program:
EXPORT V1, V2, V3;

Symb()
BEGIN
E1:= "V1+V2=V3";
E2:= "V2+V3=V1";
E3:= "V3+V1=V2";
startview(0);
END;

Thus, you 1: define the variables... 2: when the user goes to the symb view, you force E1-E3 to be what you want.

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.
Find all posts by this user
Quote this message in a reply
Post Reply 




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