Jump to content


several breaks


  • Please log in to reply
1 reply to this topic

#1 delcolt

delcolt
  • Guests

Posted 22 July 2004 - 06:30 PM

suppose i have the following script:

loop
{
loop
{
break
}
}

how can i make the break count twice but not like this:

loop
{
loop
{
break
}
break
}


#2 Chris

Chris
  • Administrators
  • 10727 posts

Posted 22 July 2004 - 07:30 PM

The way to do it is with a variable:
continue_outer_loop = y
loop 
{ 
	loop 
	{
		continue_outer_loop = n
		break 
	}
	if continue_outer_loop = n
		break
}
You could also do a return or an exit if you want to break out of all enclosing blocks and return to the caller (or, in the case of exit, terminate the current thread).