Forum Post: Re: Convert String Value Into Expression

  • Thread starter Thread starter scott_auge
  • Start date Start date
Status
Not open for further replies.
S

scott_auge

Guest
EQN is a language made to be run in the Progress ABL. It was written before Brians Maher's answer above, but it includes symbolic mathematics that can be coded. It does NOT use "compile on the fly." It is open source by me... the API is easy to use as shown below, but the internals are pretty knarly. Just be warned. www.oehive.org/.../ www.oehive.org/.../EQN.pdf Sample code: /* Insert formulas. Note these ARE strings for numbers. */ RUN AddFormula.p (INPUT “@Revenue”, INPUT “10000.00”). RUN AddFormula.p (INPUT “@Expenses”, INPUT “5000.00”). RUN AddFormula.p (INPUT “@NetProfit”, INPUT “(@Revenue - @Expenses) / 90”). /* Compute out a formula with Calc.p */ RUN Calc.p (“@NetProfit”, OUTPUT cResult). /* cResult should be 55.55555 */ and /* Enter the expression to evaluate into a string */ ASSIGN cT = “(2 + 3) * 4”. /* Call into EQN to evaluate via the Calc.p API */ RUN Calc.p (INPUT cT, OUTPUT cR). /* Convert the result from CHAR to DECIMAL or INTEGER */ ASSIGN dR = DECIMAL (cR).

Continue reading...
 
Status
Not open for further replies.
Back
Top