Help regarding a for loop.
#2

"break" is a keyword which stops/execute the functions in a loop/switch case/if else.
For example:
pawn Код:
for(i=0;i<300;i++)
   {
     if(i==74) break; //here, When i==74 it will stop/execute the loop, and the loop will not proceed further.
     else AddPlayerClass(i, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    }
"continue" is a keyword which continues to proceed the function in a loop.
For example:
pawn Код:
for(i=0;i<300;i++)
   {
     if(i==74) continue; //here, When i==74 it will continue with the loop without going to the next function ,which is AddPlayerClass (below)
     else AddPlayerClass(i, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
    }
Reply


Messages In This Thread
Help regarding a for loop. - by rangerxxll - 03.06.2014, 04:52
Re: Help regarding a for loop. - by Rittik - 03.06.2014, 05:00
Re: Help regarding a for loop. - by Koala818 - 03.06.2014, 05:03
Re: Help regarding a for loop. - by rangerxxll - 03.06.2014, 05:07
Re: Help regarding a for loop. - by Rittik - 03.06.2014, 05:11
Re: Help regarding a for loop. - by rangerxxll - 03.06.2014, 05:12
Re: Help regarding a for loop. - by Rittik - 03.06.2014, 05:16
Re: Help regarding a for loop. - by rangerxxll - 03.06.2014, 05:18
Re: Help regarding a for loop. - by Koala818 - 03.06.2014, 05:27
Re: Help regarding a for loop. - by rangerxxll - 03.06.2014, 05:42

Forum Jump:


Users browsing this thread: 3 Guest(s)