473,412 Members | 2,994 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

simple way of continuing out of outter loop

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.

I doubt such a thing exists but just curious

Thanks,
Jon

Apr 1 '08 #1
1 2595
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

Apr 3 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tolga Erdogus | last post by:
Hi, I have the following code: for (int i=0;i<childOptimizations.Length;i++) //for each partition { row = childOptimizations;
22
by: lokman | last post by:
Hi, In the following code, can someone tell me the difference between *p++ and p++ ? I can see both achieve the same result. Thanks a lot !
6
by: Rey | last post by:
Howdy all. Am attempting to delete a large number of records (123K) from a table using: db.execute "delete from tblname" Then I double check (code below) to see if records still remain as...
0
by: Greg | last post by:
I am continuing writing my simple file system and I have run across the following problem. I am writing a superblock to a certain frame in the file as follows: (&sb is the address of a...
7
by: Justin Hoffman | last post by:
I am new to vb.net programming and am just exploring the way databinding works with Windows forms and am having trouble with some fairly basic customization of data entry. The form uses the...
14
by: dba_222 | last post by:
Dear experts, Again, sorry to bother you again with such a seemingly dumb question, but I'm having some really mysterious results here. ie. Create procedure the_test As
41
by: SkyBlue | last post by:
Hi, can someone explain why the following simple C code segfaulted? I've stared it for 30mins but couldn't find the problem. Thx in advance #include <stdio.h> int main() { char *one; char...
0
by: rich | last post by:
Hi all, I have a fairly complex "feed" application that recieves messages from an external user-supplied API via a callback function, and attempts to forward these messages to another...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.