DelphiTools – This is a simple trick that can be handy to cleanup or simplify Boolean expressions, and is always good to have in your code-writing toolchest: De Morgan’s laws. These two laws allow to apply a negation to an and or or expression: (not A) and (not B) <=> not (A or B) (not A) or (not B) <=> not (A and B) So basically when you distribute a not, an or becomes an and, and vice-versa. Also keep in mind some simple comparison negation rules: not (A < B) <=> (A >= B) not (A > B) <=> (A <= B) Exemple: testing if a TRect overlaps another TRect Now, I ...
Visits by Source
Users who voted for this posting
Jørn E. Angeltveit
Kyle A. Miller