Quote:
Originally Posted by Flick3rR
Is that correct enough?
PHP Code:
new num for(new i = 1; i < sizeof Tags; i++) { if(Flag & Tags[i][flag]) { num = i break } }
|
This looks correct and will achieve what you outlined in your first post. Using break will immediately exit out of the loop and num will contain the first index at which your desired condition became true.
The only issue I see is that array indexes usually start at 0, but I don't know precisely what kind of array structure/layout you are working with here.
Quote:
Originally Posted by ^SmileY
Correct-me if i am wrong,
PHP Code:
new g_iCount;
public MyFunction() { do { g_iCount++; // or g_iCount += 1 } while(g_iCount <= 10) }
|
While this is a correct do-while loop (and a do-while can also be used to solve this problem), this code piece is irrelevant to the question.
__________________