break and return
#8

break will stop the loop from excecuting which is what you want.
Return stops everything after that from being excecuted.

The example in the first post will work as you want, it is advised to put the return at the end of the callback otherwise everything after the first loop won't be excecuted.

pawn Код:
// Loop 1
// Loop 1 returns true for your if statement
break;
// Loop 2 (Which is a new loop under Loop 1 like in your example)
// Loop 2 ends
return 1;
Hope this helps
Reply


Messages In This Thread
break and return - by GaGlets(R) - 27.12.2010, 04:16
Re: break and return - by 1337connor - 27.12.2010, 04:21
Re: break and return - by GaGlets(R) - 27.12.2010, 04:25
Re: break and return - by randomkid88 - 27.12.2010, 04:32
Re: break and return - by GaGlets(R) - 27.12.2010, 04:37
Re: break and return - by randomkid88 - 27.12.2010, 04:42
Re: break and return - by GaGlets(R) - 27.12.2010, 11:48
Re: break and return - by FUNExtreme - 27.12.2010, 11:54
Re: break and return - by GaGlets(R) - 27.12.2010, 12:03
Re: break and return - by iggy1 - 27.12.2010, 12:06

Forum Jump:


Users browsing this thread: 1 Guest(s)