473,395 Members | 1,623 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,395 software developers and data experts.

Repeating loop

I have a while loop which seems to run twice, I call one routine from another
once the first loop is completed it returns to the calling routine (the line
above) and runs again

Calling routine()
{
ComboBox.FindStringExact(Textbox.text); // routine to be called runs from
the
//next line
then returns to this line and
//re-runs
RoutineToBeCalled again
RoutineToBeCalled()
}
RoutineToBeCalled()
{
int=0;
while(i<6)
{
do work
i++;
}
}

Not easy to explain but the order is..
Combo.Findexacttext(etc)
RoutineToBeCalled()
Runs loop
Returns to Combo.Findexacttext(etc)
RoutineToBeCalled()
Re- Runs
Finishes
Nov 16 '05 #1
4 1942
NCrum <NC***@discussions.microsoft.com> wrote:
I have a while loop which seems to run twice, I call one routine from another
once the first loop is completed it returns to the calling routine (the line
above) and runs again


Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Make sure that you are not inadvertently calling the "Calling routine"
from your "do work", some code would be helpful.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

NCrum wrote:
I have a while loop which seems to run twice, I call one routine from another
once the first loop is completed it returns to the calling routine (the line
above) and runs again

Calling routine()
{
ComboBox.FindStringExact(Textbox.text); // routine to be called runs from
the
//next line
then returns to this line and
//re-runs
RoutineToBeCalled again
RoutineToBeCalled()
}
RoutineToBeCalled()
{
int=0;
while(i<6)
{
do work
i++;
}
}

Not easy to explain but the order is..
Combo.Findexacttext(etc)
RoutineToBeCalled()
Runs loop
Returns to Combo.Findexacttext(etc)
RoutineToBeCalled()
Re- Runs
Finishes

Nov 16 '05 #3
NCrum <NC***@discussions.microsoft.com> wrote:
I will (having read your note) attempt to put something simple together but
how do I get this to you? I cannot attach anything to this or do you just
want complete code listing


Complete code listing inline in a newsgroup post is probably the best
way. I'll update the web page to make this clear.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
NCrum <NC***@discussions.microsoft.com> wrote:
Thanks, both of you, I have made a small app which seems fine so I
need to work through the real code and see the difference

I refer to a statement in Jon's side note suggesting that I may solve
it myself this way!!


In this particular case, I'd almost be surprised if you didn't :)

If you'd care to have another look at the page
(http://www.pobox.com/~skeet/csharp/complete.html) and let me know if
it's a bit clearer now, that'd be great. I post that link quite often,
so it would be good to make the page as helpful as possible.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #5

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

Similar topics

1
by: John Pether (john | last post by:
I have a repeater which displays the result of a recordset and a function which determins whether to display web or email link. It works but the function is not being repeated properly, the first...
1
by: Developwebsites | last post by:
user enters non-repeating 100 numbers. how do i determine that numbs do not repeat? is this code correct? also, once a repeated number has been found, lets say I enter 345 twice, how do i break...
4
by: Rob Johnson | last post by:
I have an ASP.Net calendar feature which allows users to add events and configure whether or not they repeat at various frequencies (i.e, daily, weekly, monthly, Sat/Sun, etc.). What I'm looking...
1
by: PaulF | last post by:
I am trying to do add a repeating XmlNode into and existing XML document and have had some problems. The base XML: <Property> <Premises> <Endorsement> <ShortWording/> <Wording/>
10
by: lifity | last post by:
hi, i am stuck on part of my project and very new to VB. i had cut my picture into 6 equals part but need to display them randomly, without repeating the same part of the pic again, in random...
0
by: Killer42 | last post by:
This is a simple VB6 function to generate random numbers in the specified range, without repeating any numbers. New, and only briefly tested. Use at your own risk. :) Option Explicit Private...
1
by: redskycorp | last post by:
I have repeating values in my combo box, i do want the values to repeat...any idea how to do that ? The reason is that i am taking the values from my database table "Incomplete" from the "Topic"...
1
by: Swede.Swede | last post by:
Hello! Customer wants a gridview displaying individuals who have taken part in courses. The gridview should be sorted by the name of the participant. If a person has taken part in several...
2
Thekid
by: Thekid | last post by:
How can I get this question to keep repeating until either a yes or no is given as an answer: response = raw_input("Are you ready? ") if response.lower() == "yes": print "Alrighty then,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.