Where does your parameter file come from? How much control do you have over it's creation? Instead of saving an expression as an item in a parameter file, save is as a basic subroutine or function:
SUBROUTINE CALC.COMMISSION(RSLT,VAR.A,VAR.B,VAR.C) RSLT= (VAR.A * VAR.B)/1000 RETURN and call the subroutine when you need it instead of parsing anything. Would probably make more sense if the parameter to the subroutine was a dynamic or dimensioned array. You could also save the formula as an expression in an i-type dictionary entry and evaluate it that way. On Jun 2, 2009, at 9:37 AM, [email protected] wrote: > > Hi guys , > I have a parameter file that holds formulae on how to calculate some > charges , commissions ... > I expect formulae in various combination as below : > "(VAR.A * VAR.B) / 1000" > "(VAR.C + VAR.B) / 1000" > "(VAR.B - VAR.D) * 1000" > "(VAR.A * VAR.B) / 1000" > I intend replacing the VARs by the values dynamically in the formula > This means that at run time the formula variable will have values such > as : > "(100 * 300) / 1000" > "(900 *+ 200) / 1000" > "(100 *- 30) / 1000" > Is there in jbase a way of evaluating mathematical expressions > contained in a variable , without the peine of parsing it , and > checking which arithmetical operator is being used , so on and so > forth > > If so , how can i go about it , > > Any help is appreciated > > Thanks > > > > > --~--~---------~--~----~------------~-------~--~----~ Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24 To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en -~----------~----~----~----~------~----~------~--~---
