Skip some number using While
How can I skip a certain number using Whileloop?
Example: It will loop a number from 1 -500 however I don't want 200-300 to be counted. |
Re: Skip some number using While
Code:
|
Re: Skip some number using While
Thanks,
I have this, but it still creates a number from 1 to 649. Why is that? :/ PHP Code:
|
Re: Skip some number using While
Your code doesn't even compile . . .
You need to look at the definition of the menu_additem() function. Why are you doing a whole bunch of multiplying? It is entirely unnecessary. Explain EXACTLY what you are trying to do. P.S. (12*i)+1 is ALWAYS an odd number and will therefore never be equal to 388. However, this is a moot point because you are are doing this very wrong. |
Re: Skip some number using While
12*i+1 can't be 388. Your code is very confusing
|
Re: Skip some number using While
Code:
new i = 0Code:
new i = 0 |
Re: Skip some number using While
The second one generates less loops.
My example is still better. I suggest using a for loop for all incremental type of loops. While loops are generally used in combination with functions that work with a more true/false statement ( != 0 or == 0 ), for example feof(). |
| All times are GMT -4. The time now is 13:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.