Jump to content

Do I need parenthesis here?


Illusion

Recommended Posts

Posted

If

       Time is 12:00:00PM

    Or Time is  1:00:00PM

    Or Time is  2:00:00PM

   And Status  'Bathroom Sink Heater' is On



Then

       Set 'Bathroom Sink Heater' Off



Else

  - No Actions - (To add one, press 'Action')







If it is not clear, what I am trying to do is turn off the IR Sink Heater if it has been left on. I have the ISY looking at this three times a day. If it has been left on at any of these times I want the ISY to turn it off. Do I need Parentheses around the 'OR' arguments? I know that it will work with them there, but will it work without them there?

Posted

Illusion,

 

Yes, you need parenthesis, basically 'ANDs' are grouped together

 

A or B or C and D is the same as A or B or (C and D)

 

What I think you want is (A or B or C) and D

Posted

Hmmm, I had a program that was IF A and B or C or D and it apparently worked as I wanted it to which is IF A and (B or C or D) not (A and B) or C or D, but after reading this I went back and added the parenthesis around (B or C or D).

I'm wondering why it worked correctly without the parens.

Guest
This topic is now closed to further replies.

×
×
  • Create New...