Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 1963

How to combine OR with AND?

$
0
0

Hello, First time posting here. 

It is hard to google for this answer, please help:

 

How to combine OR with AND?

I am trying to combine 3 statements in 1, to let it do some other stuff. I am not sure though if my AND and OR statements are being read correctly. Please let me know if this is the way to handle such things (and if I should post this somewhere else but here):

 

if (Apples = Green) and (Pears = Red) or

          (Apples = Green) and (Pear = Blue) or

         (Apples = Purple) and (Pear = Red)

    then begin //do stuff

    end;

 

I have found this article (see bottom for link) which asumes Im doing this right, but as I want to be sure I would like to hear it from the pro's as well. In this article it states that AND is handled before OR:  http://docwiki.embarcadero.com/RADStudio/XE/en/Expressions_%28Delphi%29#Operator_Precedence. Thank you for any help or suggestions for search terms! 

            


Viewing all articles
Browse latest Browse all 1963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>