Equation Solver
Equation Solver
Sometime ago I developed the following program (re-produced below)
which returns the result of a mathmatical equation entered by a user.
Any one who wishes to use this is welcome.
- The equation can be entered as text
- It can refer to variable names, the variable names must be stored in
comma separated list and corresponding decimal values in an array.
- It can use brackets
- The equation can have intermediary value stored in variables
invented by the user.
E.g. of text entered by the user
1. A = X * .1.
B = Y + Z.
A / B.
2. (X * .i) / (Y + Z).
In both examples X and Y are variables, A and B are intermediate
values that user wishes to create for clarity.
Usage.
Define the following shared variables
Define new shared var ms-var as ch.
Define new shared var ms-val as dec extent 500.
ms-var = 'var1,var2,var3,......varn'.
ms-val[1] = x ms-val[2] = y .... ms-val[n] = n.
Run cal-eq.p(input equation-text,output result)
calc-eq.p contains the program script.