Thread: goto
View Single Post
  #11  
Old 02-02-2008, 08:46 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Quote:
Originally Posted by Skyld View Post
How does that have anything to do with wanting "goto"?
PHP Code:
for( foo 0foo 100foo++ )
  {
  for( 
bar  0bar 100bar++ )
    {
    
mehfoo ][ bar ] = blub;
    if( 
/* do something that would exit the loop */ )
      goto( 
lEndL01 );
    }
  }
Label lEndL01:
//after loop 
Quote:
Originally Posted by Skyld View Post
It's called "return", and will end function execution there and then, regardless of how many loops you have.
you don't always want to end the whole function :P
__________________
Reply With Quote