Raised This Month: $ Target: $400
 0% 

Questions about "for" loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 11-04-2014 , 00:33   Questions about "for" loop
Reply With Quote #1

How does the for loop respond too "continue", "break" and "return" ?

If i want to stop looping and jump to the code after the loop after some condition is satisfied which one should i use.

Example:

PHP Code:
public myfunc(id)
{
          for(new 
1<= max_playersi++)
          {
                   if(
some condition that was satisfied)
                   {
                   
want to stop looping 
                   
return/continue/break ?
                   }
          }

          
Still want to execute this code(id)
          {

          }


If i want to jump to the next loop in the same condition then which one ?

Similarly if i want to just return the value and stop executing the ENTIRE function then ?
__________________
You will find everything u need :-

Last edited by Catastrophe; 11-04-2014 at 00:34.
Catastrophe is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode