View Single Post
  #6  
Old 05-24-2009, 05:02 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Thanks you guys. I'll try that out.

Quote:
Originally Posted by DustyPorViva View Post
Why do:
for (temp.i = 3; i > 0; i --) {
sleep(1);
}

instead of just doing sleep(3)?
Isn't the for (temp.i = 3; i > 0; i --) {} thing an array? (correct me if i'm wrong but i think thats what its called)
I've seen these alot. and apparently it can be very useful in certain script.
Could someone explain how this works? Its always seemed very confusing to me. reading how "for" works in the offline editor helps a little, but what's it checking? and what exactly is that script doing?

i would guess it's checking if temp.i = 3. or is it setting it to 3? then telling it it's greater than 0 then subtracting 1?

or, by looking at Dusty's comment, is it producing three one second sleeps?
then once temp.i == 0, it tells it to stop telling it to sleep.. or something?

and where's it pulling the initial value for temp.i from anyway?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote