> I'm looking for an expression evaluator that is able of the following
> (and works under fpc - I tried TExpressionParser from Egbert van Nes
> but even if it compiles, it doesn't works... unless this is me not
> using it properly):
>
> //this is a pseudo example of the functionnality I'm looking for:
> ExpressionParser.AddVariable('Var1 := 2 + 2');
> ExpressionParser.AddVariable('Var2 := (2 * 2) / 2');
> ExpressionParser.AddVariable('Total := Var1 + Var2 + MyFunction(2,3,4)');
> ExpressionParser.AddFunction('MyFunction', 3); //number of parameters
> result := ExpressionParser.GetResult('Var2');
> result := ExpressionParser.GetResult('Total');
>
> ExpressionParser.OnFunction(const functName: string; var: array of
> string; var result: string);
> begin
> result := '0';
> if functName = 'MyFunction' then
> result := '5'; //could process the variables...
> end;
Check FPC+Lazarus attic, and you'll find:
fpcprojects/contrib/symbolic
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives