- Home /
What's wrong with this Loop?
var p : int = 0;
for(p=0;p=100;p++) { //my code here }
is javascript fooling me? D:
What @Eric5h5 said - but I'll also add, there is a a bio/profile box in your User profile. Go to your profile by clicking on your name, click edit, and put whatever signature information you want in it. Anyone who clicks on your name will see it.
Answer by CHPedersen · May 17, 2011 at 09:29 AM
The condition for the loop to execute is that p should be exactly 100. But you've set p to start at 0, so the loop never executes.
Did you mean to write p < 100?
indeed that works. i will throw in some code as answer o u can see what im trying to do
Answer by Jace · May 17, 2011 at 10:19 AM
Also, please note that p=100 is an assignment and not a comparator. If you ever did need to test that p is 100 (which granted I suspect you don't) you should use p == 100