I've got a program that sets a variable to 1 during two separate time spans. A couple other programs use this variable to determine what to do. If Variable = 1 than do something, if not, then do something else.
This all works just fine.
What I want to do is toggle the variable to 1 or 0 by either pressing a button on my inseton mini remote or by running a program from my MobiLinc app.
This seems like it should be dirt simple, but I am stumped. Programs run as event loops, right? So, I can't just run once and done.
Two problems with my scenario.
1: the time span part will override my variable value, setting it back to 1 no matter what I do during that time span.
2: if $var == 1
$var = 0
else
$var = 1
is an infinite loop.
Can someone straighten me out? Is it possible to toggle a variable value with a button click or a tap on my MobiLinc app?
Thanks in advance