Maybe the IsFalse() single line Macro, does the trick? (instead of: IsNot() ...)caseih wrote: Maybe we need an IsNot operator.
Code: Select all
#Define IsTrue(e) ( CBool(e) )
#Define IsFalse(e) ( Not CBool(e) )
Dim As Double d1 = 1.257
Dim As Single s1 = 3.333
Dim As Long l1 = 1023, l2 = 321
' check expression evaluation is working (before conv.)
Print : Print Str(d1 * l1 / (s1 + l2)), Str(l1 \ l2 + (d1 - s1))
Print IsTrue(d1 * l1 / (s1 + l2)), IsFalse(d1 * l1 / (s1 + l2)), _
IsTrue(l1 \ l2 + (d1 - s1)), IsFalse(l1 \ l2 + (d1 - s1))
d1 = 2.5 : s1 = 1.25
' is there a difference between -1 / +1
Print : Print Str((d1 / s1) * -.5), Str((d1 / s1) * -.5), _
Str((d1 / s1) * .5), Str((d1 / s1) * .5)
Print IsTrue((d1 / s1) * -.5), IsFalse((d1 / s1) * -.5), _
IsTrue((d1 / s1) * .5), IsFalse((d1 / s1) * .5)
' test the 3 possible boolean values (+1 is in mem. representation)
Print : Print Str(0), Str(0), Str(-1), Str(-1), Str(1),Str(1)
Print IsTrue(0), IsFalse(0), IsTrue(-1), IsFalse(-1), IsTrue(1), IsFalse(1)
Sleep