Post Reply 
HP Prime: how to insert and save formulas in a sort of "Equation library"
05-17-2020, 04:16 PM (This post was last modified: 05-18-2020 03:37 PM by BERNARD MICHAUD.)
Post: #17
RE: HP Prime: how to insert and save formulas in a sort of "Equation library"
(05-17-2020 03:48 PM)BERNARD MICHAUD Wrote:  
Quote:I've recently bought an HP Prime.

HI MARK
copy/paste the code below.
Start the Connectivity kit(CK) on your pc.
Connect your Prime calc. to the USB port, and turn ON.
In the CK click on the triple folder icon (top left corner).
Your Prime will show up in a list. Right click on Program.
In the pop-up box [New/Clear] click on New. In the box, below Program type [MLibrary] & Return.
A window will pop-up in the coding area with the following.
EXPORT MLibrary()
BEGIN

END;

DELETE those three lines and copy/paste the text from the Codewindow below over to the window where you erased those three line in the CK.
Next click on the Single disket icon to the right of the Blue icon and the program will be saved to your calculator.

On your calculator click [Shift] then [1/Program] key.
Your screen will display a list of all programs on your Prime.
Higlight MLibrary and press the [Run] key.

A small window will open on the screen with a Heading

[Finance]
[1 Accounting]
[2 Economic]

Click on [1 Accounting] a box will appear so just press the [ESC] key.
in the background appears the solver containing 5 of the equations from the Accounting section.
At this point select any one of the equations and tap the check mark [ ] on the soft menu below.
Next press the [Num] key. A new window will pop up with boxes with all the variables contained in the equation you selected. You can now enter values any values in the boxes except the box for which you want to solve. Select the box for which you want to solve and press [Solve] in the soft menu.

re: Variables. All the variables used by the equations that are not single Cap letters have to be declared with the EXPORT statement or will cause an error and your program terminates.
The single Cap. variables like T,F,C etc do not have to be declared since they are Global variables as explained by Tim above.

After you are through with this equation, press [Symb]key and return to the set of equations and
select another equation followed by [Num]. To evoke the other set of equation, (Economic),you will have to restart the program and repeat the process.

I tried to make this as explicit for you, assuming that you are a novice with the Prime and hope it's not over symplified.

Have fun

Code:


EXPORT Lib,int;
EXPORT SP,NP,TR,TC,TFC,TVC,VC;
EXPORT n,PMT1,PRV,FV1;

EXPORT MLibrary()
BEGIN

STARTAPP("Solve");

CHOOSE(Lib,"Finance ",
{   
"   Accounting",
"   Economic "
});

//Accounting
IF Lib==1 THEN
E1:="SP=C+M";
E2:="NP=TR-TC";
E3:="TR=P*Q";
E4:="TC=TFC+TVC";
E5:="TVC=Q*VC";
E6:="";
E7:="";
E8:="";
E9:="";
E0:="";
END;//End of Accounting routine.

//Economics
IF Lib==2 THEN
E1:="int=(FV1/PRV)^1/n-1";
E2:="PMT1=PV*(int)/(FV1)";
E3:="";
E4:="";
E5:="";
E6:="";
E7:="";
E8:="";
E9:="";
E0:="";
END;//End of Economics routine.
END;//End of BEGIN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread



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