Jump to content

and+or?


MikeB

Recommended Posts

If I create a program that contains both an 'and' and an 'or' in the IF statement, how does it get parsed?

 

IF

status "switch 1" is on

and status of "switch 2" is on

or status of "switch 3" is on

 

Is it parsed like this:

 

IF

[status "switch 1" is on

and status of "switch 2" is on]

or status of "switch 3" is on

 

or like this:

 

IF

status "switch 1" is on

and [status of "switch 2" is on

or status of "switch 3" is on]

 

 

It might be nice to clarify that in the program content window when the commands are entered.

Link to comment

Thanks...

 

So, I can combine these 2 programs:

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'FoyerControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

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

 

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'MasterBedControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

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

 

 

 

..with this:

 

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'FoyerControls1G' is not Off
    Or Program 'Floor 1 Status Update' is False
   And Status  'MasterBedControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

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

 

Correct?

Link to comment

Doh!!!! I didn't even see that!

 

OK, so is this the equivelant?

 

If
       Program 'Floor 1 Status Update' is False
   And (
            Status  'MasterBedControls1G' is not Off
         Or Status  'FoyerControls1G' is not Off
       )

Then
       Set  Scene 'Floor1StatusLight' Off

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

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...