On January 12, 2009 at 22:35, shepdawg7 said...
I also use them in conjunction with UI variables, especially
power states of components. Example:
IF [UI Variable (TV Power), False]
TV Power On
Delay 3.0s
TV/ Video 1
ELSE
TV/ Video 1
I do something similar, but I tend to not use the ELSE statements. I would move the TV/Video 1 statement out of the IF/ELSE make it part of the rest of the macro as it is going to be fired no matter what the outcome of the IF statement. It would look like this:
Page Jump, Wait Page 1
IF [UI Variable (TV Power), False]
TV Power On
Delay 3.0s
ELSE
--------------------------
TV/ Video 1
Page Jump, TV Page 1
I just leave the ELSE statement blank. So if the TV Power is false, the TV powers on and waits 3 sec. If the TV Power is true, nothing happens and the next step of the macro is run which is the TV Input. This makes it easier to embed multiple IF/ELSE in a macro. Mine would actually look more like:
Page Jump, Wait Page 1
IF [UI Variable (TV Power), False]
TV Power On
Delay 3.0s
ELSE
--------------------------
IF [UI Variable (TV Video1), False]
TV Video 1
ELSE
--------------------------
Page Jump, TV Page 1
This keeps the Video 1 command from being sent if it is not needed. Granted, things can get off kilter here but the OFF button will reset all variables.
Just the way I do it. It could be wrong.