Jump to content

and+or?


MikeB

Recommended Posts

Posted

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.

Posted

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?

Posted

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')

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...