Re: Writing a complex loop
I would be more concerned with the fact that it may take several minutes or more to execute and that it would return over 10 billion results.
From what you have said thus far though I am guessing that this number of elements to be processed is going to be variable so nested loops may be an issue there. A recursive function call may be a better choice but as I have pointed out before without knowing what you are really trying to do it is hard to give proper advice.
What are you going to do with these 10 billion or so results?
Re: Writing a complex loop
i'm going to find those results which are equal to my goal (which is either 6336 or 6438).
that recursive function sounds promising but i don't know how to write one. would you please give me a sample as well as how to put such function in my loop in order to get it done?
thanks
Re: Writing a complex loop
How would you determine when you meet your goal? Seems like there has to be a much better way than stepping through 10 billion cycles of a loop or 10 billion anything really.
As for the sample, I am a VB coder so C# syntax off the top of my head is questionable. The idea behind a recursive function is to have the function call itself with parameters. Efectively it would work like a series of nested loops but the actual number of recursions(nests) would be variable based on the input.
I'm sure it would be easy to find an example of a recursive function via google.
Good luck with your project, I am going to leave this thread now, I've tried to get enough info to suggest some proper logic but given what I have to go on it seems a waste of time to try any longer.