No, boolean operators are not supported directly.
From the docu:
You can use the following math symbols in your expressions:
- Constants: nil True False Pi
- Arithmetic operators: + - * /
- Logic operators: = <> < <= > >=
- Parentheses, (), to change operator precedence.
But you can use the builtin functions IfAll()
, IfAny()
and IfThen()
instead of and
, or
and not
:
SourceExpression := 'IfAll(IfThen(Checked, False, True), Enabled)'
Or you register your own functions.
I tested this 4 XE4, but it should work for XE2 2.
A or B
: IfAny(A, B)
A and B
: IfAll(A, B)
not A
: IfThen(A, False, True)
A xor B
: IfAll(IfAny(A, B), IfThen(IfAll(A,B), False, True))
SourceExpression = '(not Checked) and (Enabled)'
? And why ? Because it hurts my eyes whenever I see=
in boolean expression :-) But don't have Delphi XE2 right now... – TLamanot Checked
is not supported, so I useChecked = False
– Chau Chee Yangand
,or
, ´not´ , ´xor´, ´shl´, ´shr´) in a LiveBinding expression :(, as workaround you can register a custom method to evaluate the logical operation. – RRUZ