"If" statement help

More
2 years 4 months ago #1822 by bitzerjd
"If" statement help was created by bitzerjd
I know this is super simple, but it's not for me....  What is the correct syntax for a If, Then, Else Macro (or command).

If
Variable X = 0
then
AV|14.........
else
AV14,,,,,,,

I know how to set variables and call commands, just not sure on the correct syntax for the If statement.

Thanks in advance!

Please Log in to join the conversation.

More
2 years 4 months ago #1824 by David Li
Replied by David Li on topic "If" statement help
allonis.com/support/documentation?view=category&id=247
There is an example in that article.
That article needs a lot of updating and cleaning up but has most all of the basics.

Please Log in to join the conversation.

More
2 years 4 months ago #1825 by bitzerjd
Replied by bitzerjd on topic "If" statement help
Like this?

if|isequal##{{active_tivo}}##{{11}}##{{AV|{{active_tivo}}~Tivo##{{AV|{{active_tivo}}~Main

Check if the active tivo is 11 and if it is run the Tivo command and if not run the Main command.

Thanks for the link!

Please Log in to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #1827 by davep
Replied by davep on topic "If" statement help
No, only put the server variables in curly braces.

if|isequal##{{active_tivo}}##11##AV|{{active_tivo}}~Tivo##AV|{{active_tivo}}~Main

The Tivo driver has a command AV|<id>~Tivo   but not a AV|<id>~Main command. Is Main a valid Tivo command? If so I'll add it in the driver.
Last edit: 2 years 4 months ago by davep.

Please Log in to join the conversation.

More
2 years 4 months ago #1829 by bitzerjd
Replied by bitzerjd on topic "If" statement help
Thanks!!!

"Main" was a mistype ...no action required.

Now I can go and implement my logic!

Please Log in to join the conversation.

More
2 years 4 months ago #2129 by bitzerjd
Replied by bitzerjd on topic "If" statement help
I saw this example in your docs.

If|isEQ##{{variable_x}}{{variable_y}}##onoff##do something interesting

In the example variable_x = on and variable_y=off   

How does it know to parse ##onoff##  Shouldn't there be a delimiter between the values?  In my case the variables are 0 and 1 so it would be some combo of that. 00, 01,10 etc.

Thanks!



 

Please Log in to join the conversation.

Time to create page: 0.194 seconds