Re: Error with OR operator
To figure out how to write the conditions correctly, write a small simple program with a loop with the if test inside. Add printlns to show when the conditions are true and when they are not and to show the value of i for both those cases.
Re: Error with OR operator
Ohhhhhhhhh, I can't beleive it... I'm so simple!!! Thanks very much for the quick feedback. I'm so sorry for such a stupid post :((
Re: Error with OR operator
No problem. Lots of programmers have problems with != and || together.
A quick short program to printout what is happening and the light comes on.