Re: Simple boolean expression evaluator



On Tue, 21 Jun 2005 11:26:11 -0400, "Richard Marchand"
<richardm@xxxxxxxxxxx> wrote:


>I am searching for a simple function that will take a string of boolean
>expressions like:
>
> "((True of false) and (false or false)) or (true and false)"
>
>And return a boolean result.
>

I have a class that implements this kind of search, will post it to
..attachments in a minute. It's based on example code by Julian Bucknall
(published in Delphi Magazine once), which I modified to break into
specialized classes and to make the evaluator event-driven. I'm using it in
an application without a problem, but it's not very fast and the way it
works doesn't allow for shortcut evaluation. Feel free to use it for any
purpose if it does what you need.


..marek

--
No ads, no nags freeware: http://www.tranglos.com
(KeyNote, PhoneDeck, KookieJar, Oubliette, URLInject)

"No man's life, liberty, or property is safe while the
legislature is in session." (Judge Gideon J. Tucker, 1866.)

.



Relevant Pages

  • Re: Simple boolean expression evaluator
    ... Richard ... >>I am searching for a simple function that will take a string of boolean ... >>And return a boolean result. ... > (published in Delphi Magazine once), which I modified to break into ...
    (borland.public.delphi.thirdpartytools.general)
  • Dynamic SQL to call a function with RETURN value?
    ... I have done quite a bit of searching ... and 'trial and error' without much success. ... In an Anonymous Block, if I had a list of the ... FUNCTION test_positiveRETURN BOOLEAN AS ...
    (comp.databases.oracle.misc)
  • Re: Regular Expression
    ... called .contains where if a cell contained the string or regular ... expression you were searching for it returned a boolean of True or ... In addition to Harlan's suggestion, to use regular expressions in a UDF, ...
    (microsoft.public.excel.misc)
  • Re: Why is A97 InStr FN returning True or False instead of a string?
    ... the string var assumes the Boolean value of True. ... The string segment I'm searching for is this... ...
    (comp.databases.ms-access)
  • Re: How can I locate a paragraph using the .find method ?
    ... > Dim FoundText as Boolean ... > How can I extract the exact paragraph object where this text is found? ... Selection.Find.Execute "The text I am searching for" ...
    (microsoft.public.word.vba.general)