This is oddly enough the reason I stopped using some other forum. Of course this was when I first started with java long ago. Well here is the subject first:
A snippet from my infinite textbox code:
do { g.drawString(content[iii],x+letterW*ii,y+letterH*i); ++ii; if(boundX < ii) { ii = 0; ++i; } ++iii; }while(iii < Array.getLength(content) || i > boundY);
Now the thing that got me stuck - keep in mind this is not the exact example because in this case as simple && would suffice where as my original (can't remember that far back) would have been more specific - is this could easily give you a run-time error of ArrayIndexOutOfBounds. If I can just cut to the end ..
The logic of the do while is:
Call this option A)
"continue while true"
And it is not:
we'll call this option B)
"Break when false"
Believe it or not this was the start of never ending debate. The simple fact is java at runtime analyzes conditions between the logical or operator individually for efficiency so java does this.
while( something || somethingElse )
it first say's is something true?
CASE 1 something is not true
A) continue to the next condition
B) break
CASE 2 something is true
A) loop back up
B) check the next condition
I bring this up for two reasons, One, it is a good thing for new programmers to know it will help them avoid some serious mishaps, Two, I am kind of curious how you fellows take this.