gregoryx Posted February 8, 2009 Share Posted February 8, 2009 I see a little "else" stuff here and there... and I feel like I'm really missing some program functions by not knowing how to use it right. It seems when I see it it's used something like "if control of a device turns ON then..." and the else is... uh... any other type of control? of that device? It confuses me. Can someone point me to examples where it's making the program work or work better? Link to comment
MikeB Posted February 8, 2009 Share Posted February 8, 2009 Hey Gregory - ELSE will run when something in the IF statement is specifically not true. For example this program: If IR '1' is Pressed And IR '2' is not Pressed Then Set Scene 'TheaterMain' On Else Set Scene 'TheaterMain' Off The THEN statement will run if the program is TRUE (IR 1 is pressed), and the ELSE statement will run if the program becomes FALSE (IR 2 is pressed). Link to comment
jrabin Posted February 8, 2009 Share Posted February 8, 2009 If IR '1' is Held And IR '1' is not Released Then Set 'Lamp' Fade Up Else Set 'Lamp' Fade Stop Link to comment
gregoryx Posted February 9, 2009 Author Share Posted February 9, 2009 ELSE will run when something in the IF statement is specifically not true. okay... I gotta chew on that for a bit. Effectively, it makes for two cases to run things if I can figure out how to use it right. Thanks! Link to comment
CJVann Posted February 20, 2009 Share Posted February 20, 2009 Edit: I made an incorrect statement and didn't want to confuse anyone, so I'm removing this message (original message show in next post below) Link to comment
Sub-Routine Posted February 20, 2009 Share Posted February 20, 2009 If I understand, the only time an "ELSE" would run is if another program called its "Run (If)". Otherwise, if the program triggers on its own, the "IF" conditions were already true and the "ELSE" would not run. Not exactly. A program is evaluated every time any of the Conditions in the program change. If the conditions are met the Then clause is executed, otherwise the Else actions are performed. In jrabin's program example anytime IR '1' changes the program is evaluated. Rand Link to comment
Sub-Routine Posted February 20, 2009 Share Posted February 20, 2009 Oops. Add Schedules to the reason a program runs, not only Conditions. Rand Link to comment
CJVann Posted February 27, 2009 Share Posted February 27, 2009 A program is evaluated every time any of the Conditions in the program change. If the conditions are met the Then clause is executed, otherwise the Else actions are performed. Thanks Rand - Maybe you can help me understand why this doesn't work. I would expect the light to dim to 35% after 1 minute UNLESS I turn it off or dim it at the switch. Then I'd expect it to stay at whatever level I set it to. Turning it off does what I'd expect, it turns off and stays off. But if I dim the light, the program continues to Run and stays "True", then dims to 35% after the 1 minute is up. If Control 'Front: Lights' is not switched Dim And Control 'Front: Lights' is not switched Off And Control 'Front: Lights' is not switched Fast Off Then Set 'Front: Lights' On Wait 1 minute Set 'Front: Lights' 35% Else - No Actions - (To add one, press 'Action') Link to comment
CJVann Posted February 27, 2009 Share Posted February 27, 2009 Actually, I was doing some testing on this trigger, and I can't get this program to trigger either. I tried dimming up, dimming down, dimming from full-On, brightening from full-Off... Maybe there's a bug? If Control 'Front: Lights' is switched Dim Then Set 'Kitchen: Light' On Else - No Actions - (To add one, press 'Action') Link to comment
Algorithm Posted February 27, 2009 Share Posted February 27, 2009 Actually, I was doing some testing on this trigger, and I can't get this program to trigger either. I tried dimming up, dimming down, dimming from full-On, brightening from full-Off... Maybe there's a bug? If Control 'Front: Lights' is switched Dim Then Set 'Kitchen: Light' On Else - No Actions - (To add one, press 'Action') Hi CJ, Instead of switched Dim, try using switched Fade Down. Link to comment
CJVann Posted February 27, 2009 Share Posted February 27, 2009 Instead of switched Dim, try using switched Fade Down. Thanks Darrell, that trigger worked great. What do the "If control x is switched bright/dim" triggers do? Link to comment
Recommended Posts