Enter "if" based on either of two variables changing
Posted: Mon Jun 30, 2014 7:41 pm
I'm not a programmer so this is might be rough way to ask this question not knowing the proper lingo but here goes. I would like to enter the same set of statements within an "if" based on whether either of two variables have changed in my last loop?
The best way I can think of to lay this out hopefully will give the idea. I realize the syntax is going to be wrong below. I guess that is what I am asking for. correct syntax.
hope this makes sense... Don't want run it if BOTH variables have been changed (I could use nested if's for that). Want to run that code if either of the two have changed.
Nick
The best way I can think of to lay this out hopefully will give the idea. I realize the syntax is going to be wrong below. I guess that is what I am asking for. correct syntax.
Code: Select all
if ( PreviousVariable1 != CurrentVariable1 ) or ( PreviousVariable2 != CurrentVariable2 )
{
do stuff
do more stuff
do even more stuff
}
PreviousVariable1 = CurrentVariable1;
PreviousVariable2 = CurrentVariable2;
else
Nick