Boolean expressions


Hi, I had been testing this library, it's awsome, but It looks like the boolean expressions have some problems an expression like "100>50 and 30>50" returns "1" instead of "0" (False), and "30>50 and 100>50" returns "0". I think that the Calculate() methos is only evaluating the first part of the expression.


exigeguy wrote Feb 6, 2008 at 8:12 PM

I tried your test case and I was able to get it to work by wrapping either side of the and with parenthesis, e.g. (100 > 50) && (30>50). I had to add the CAnd operator in the InitFunctions() method. The problem is it gets fouled up trying to evaluate complex logical expressions because it is trying to evaluate 50 && 30>50 instead of maintaining the expression to the left of the && operator. I fixed it locally and also added support for string operations.

wrote Jan 20, 2010 at 6:59 PM

wrote Feb 13, 2013 at 4:43 AM

Parks75 wrote Jun 2, 2014 at 2:45 PM

I'm having the same issue trying to do a Bitwise AND on two integers. It always returns 1.