I'm looking for a formula parser in delphi, that can handle conditions (ie,
IF statements).
I can find a number of parsers that can handle basic maths (ie, 2+2, 2*2,
2/2, 2-2), etc, but what I need is something that can also handle if (or
iif) statements.
ie: iif(2>1, 1+1, 2*2)
(What I would like to be able to do in my application is have a table called
formula's. where the user can store certain formula's, and the application
make adjustments to calculations based on those formulas. In order to do
this, I need the user to have the ability to apply constraints/conditions
such as if a value is greather than, less than or equal to, and then the two
resulting values, etc).
Can anyone help me please?
Thanks & Regards
Adam.
> I'm looking for a formula parser in delphi, that can handle conditions (ie,
> IF statements).
http://www.remobjects.com/page.asp?id={9A30A672-62C8-4131-BA89-EEBBE7E302E6}
Does it fits your needs?
Greetings,
Björn
--
Björn Schreiber, DRIGUS GmbH
new...@drigus.de
Bei Email NOSPAM in den Betreff aufnehmen.
Put NOSPAM in subject to reach me by email.
>> I'm looking for a formula parser in delphi, that can handle conditions
>> (ie, IF statements).
>
> http://www.remobjects.com/page.asp?id={9A30A672-62C8-4131-BA89-EEBBE7E302E6}
>
> Does it fits your needs?
Thanks for your reply, although I'm not sure that it's exactily what I'm
looking for. If I understand this set of components correctly, these are
more script parsers (similar to Jedi's TJvTranslator component). What I'm
chasing is more a expression calculator that has the ability to perform if
(or iif) statements - similar to that in Excel (although I don't have the
need to parse variables to it - but I'm assuming if something exists, that
would be the context that it work work with).
But thanks for your post anyway.
Cheers
Adam.
What about Scripter Studio from http://www.tmssoftware.com/
Roy Lambert
you may use the parser which included in SMImport:
http://www.scalabium.com/smi
Check the sample in DEMOS\Evaluator directory. There is a sample both for
visual expression dialog (where end-user can edit the formula) and for
evaluator (TSMIParser class)
--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshk...@scalabium.com
"Adam H." <ahai...@rREMOVEMEspamSTOPPER.jvxp.com> wrote in message
news:46f6fcb7$1...@newsgroups.borland.com...
> What about Scripter Studio from http://www.tmssoftware.com/
Thanks for the suggestion, but once again, it seems more like a pascal
scripter rather than just an expression evaluator.
I think Mike has what I'm looking for though!
Cheers
Adam
> you may use the parser which included in SMImport:
> http://www.scalabium.com/smi
>
> Check the sample in DEMOS\Evaluator directory. There is a sample both for
> visual expression dialog (where end-user can edit the formula) and for
> evaluator (TSMIParser class)
Perfect! Thanks heaps. I've already got SMImport and SMExport, and had no
idea this little gem was already sitting here in Delphi ready to be used!
:-)
It allows for exactily what I'm after!
Cheers
Adam.
It can handle real numbers, integers, booleans and strings. The unit
test shows how to use it.