Posted November 18, 200717 yr 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.
November 18, 200717 yr Hi Mike, All the And conditions are grouped together, making your first example the correct one. i.e. A and B or C and D is equivalent to (A and or (C and D)
November 18, 200717 yr Author 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?
November 18, 200717 yr Yes, you can combine these programs. You should also be aware of the And (...) / Or (...) buttons, they allow you to explicitly specify parentheses so you can have more complex programs.
November 18, 200717 yr Author 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')
November 19, 200717 yr Mike: That looks to me like it should work. I used the parentheticals already in one program and they worked as expected. Best wishes,
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.