Why is this IF statement being ignored?
in
Programming Questions
•
17 days ago
So, I'm basically wondering why the code here doesn't seem to like this IF statement. I have the variable defined:
boolean secondLap = false;
followed by the code related to it:
if (secondLap = true) {
The code to activate
}
The problem is, this code within the IF keeps on running each Draw cycle regardless. Nothing else in the code uses the secondLap boolean value or changes it, and if I comment out the whole IF statement, only then will it not run. Why is it running the code in the IF when it shouldn't?
I'm using "Processing 2.0.3" to run this code.
boolean secondLap = false;
followed by the code related to it:
if (secondLap = true) {
The code to activate
}
The problem is, this code within the IF keeps on running each Draw cycle regardless. Nothing else in the code uses the secondLap boolean value or changes it, and if I comment out the whole IF statement, only then will it not run. Why is it running the code in the IF when it shouldn't?
I'm using "Processing 2.0.3" to run this code.
1