Creating a custom app with multicharacter variables AND pre-populating E1 equation? - 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: Creating a custom app with multicharacter variables AND pre-populating E1 equation? (/thread-16685.html) |
Creating a custom app with multicharacter variables AND pre-populating E1 equation? - spiff72 - 04-18-2021 02:54 AM 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. RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation? - Han - 04-18-2021 04:45 AM (04-18-2021 02:54 AM)spiff72 Wrote: Hello all, 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 RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation? - spiff72 - 04-18-2021 06:08 AM 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... RE: Creating a custom app with multicharacter variables AND pre-populating E1 equation? - cyrille de brébisson - 04-19-2021 02:56 PM 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 |