Re: simple way of continuing out of outter loop
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 08:56:30 -0500
Jon Slaughter wrote:
Say I have two nested foreach loops, is there any simple way of
continuing out of the outter most loop depending on what happens in
the inner most?
e.g.,
foreach(int i in I)
{
foreach(int j in J)
if (j == 3)
break.continue;
}
where break.continue means break out of inner loop and continue in
outter loop.
With the code you showed, just "break;" will do exactly that (because the
inner loop is the last statement block in the outer loop body).
I doubt such a thing exists but just curious
Thanks,
Jon
.
- Follow-Ups:
- Re: simple way of continuing out of outter loop
- From: Jon Skeet [C# MVP]
- Re: simple way of continuing out of outter loop
- References:
- simple way of continuing out of outter loop
- From: Jon Slaughter
- simple way of continuing out of outter loop
- Prev by Date: Re: threads (exceptions)
- Next by Date: Re: simple way of continuing out of outter loop
- Previous by thread: Re: simple way of continuing out of outter loop
- Next by thread: Re: simple way of continuing out of outter loop
- Index(es):
Relevant Pages
|