473,659 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.FindSt ringExact(Textb ox.text); // routine to be called runs from
the
//next line
then returns to this line and
//re-runs
RoutineToBeCall ed again
RoutineToBeCall ed()
}
RoutineToBeCall ed()
{
int=0;
while(i<6)
{
do work
i++;
}
}

Not easy to explain but the order is..
Combo.Findexact text(etc)
RoutineToBeCall ed()
Runs loop
Returns to Combo.Findexact text(etc)
RoutineToBeCall ed()
Re- Runs
Finishes
Nov 16 '05 #1
4 1954
NCrum <NC***@discussi ons.microsoft.c om> 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.co m>
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.FindSt ringExact(Textb ox.text); // routine to be called runs from
the
//next line
then returns to this line and
//re-runs
RoutineToBeCall ed again
RoutineToBeCall ed()
}
RoutineToBeCall ed()
{
int=0;
while(i<6)
{
do work
i++;
}
}

Not easy to explain but the order is..
Combo.Findexact text(etc)
RoutineToBeCall ed()
Runs loop
Returns to Combo.Findexact text(etc)
RoutineToBeCall ed()
Re- Runs
Finishes

Nov 16 '05 #3
NCrum <NC***@discussi ons.microsoft.c om> 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.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
NCrum <NC***@discussi ons.microsoft.c om> 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.co m>
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
1908
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 record is being repeated for all results.....any help would be appreciated on how to overcome this.... I have the following function at the top of my page: <% strEmail = GetListings.Fields.Item("Email").Value strWWW =...
1
2137
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 out of loop? could someone test this with random(1-1000). const int MAX=100; int Numb; bool exists;
4
6114
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 for is some C# code that will calculate a date of "Every Other Week" based on a starting date and ending date. Example: If a user enters an event dated October 3, 2005 and would like it to repeat every other week until October 31, 2005, the code...
1
1316
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
3400
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 sequence. eg, pic1,pic2,pic3,pic4,pic5,pic6 to ==> pic3,pic2,pic6,pic1,pic5,pic4 below are part of my code Dim theImage(0 To 7) As Object Dim myArray(0 To 7) As Object
0
9338
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 UsedNumber As New Collection Private Const MaxAttempts As Long = 150 Private Const Zero As Long = 0 Private Const One As Long = 1
1
1683
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" column....The values repeats it self cause it shows all the values in the column including repeating ones....Anyone know what to do ? I have also included my codings...... Dim data As DAO.Database Dim rec As DAO.Recordset Private Sub Form_Load()...
1
2207
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 courses, the name should only be stated once. Example: Course Participant Date Skateboarding John Doe May 1st 2007 Sailing Mary Doe June 5th 2007 Skateboarding June 10th 2007
2
1943
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, let's begin!" if response.lower() == "no": print "Try again later when you are ready"
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.