02-12-2023, 03:13 PM
Thanks for these examples Steve, they are great. I've printed them off and placed them in my Basic Binder. The Looping I have down pat but the jury is still out on if Recursion is a worthy replacement for a Do..Loop/For..Next etc. In some of my formulas I have some pretty deep nesting of the various loops and the results, while accurate take a long time to complete. In one case I had a For...Next nested 6 deep
ie For U = 1 to 50
For V = 2 to 51
For W = 3 to 52
etc
It damn near took the whole day to complete the calculations. So I'm trying to explore Recursion as a substitute for those standard Do and For loopings. I haven't yet figured the algorythm correctly but on first blush it doesn't appear Recursion can be nested. I can stack Recursion calls but to nest Recursion calls seems I need to set the Recursion call in says a Select Case type algorythm. Not a true nesting but close.
I hope Recursion will be as accurate as the nested For loop above but faster. Plus I'm hoping I don't crash. I'm thinking that crashing a recursive routine is dependent on your computer's configuration. I may need to crash to find the limit my computer has with Recursion.
ie For U = 1 to 50
For V = 2 to 51
For W = 3 to 52
etc
It damn near took the whole day to complete the calculations. So I'm trying to explore Recursion as a substitute for those standard Do and For loopings. I haven't yet figured the algorythm correctly but on first blush it doesn't appear Recursion can be nested. I can stack Recursion calls but to nest Recursion calls seems I need to set the Recursion call in says a Select Case type algorythm. Not a true nesting but close.
I hope Recursion will be as accurate as the nested For loop above but faster. Plus I'm hoping I don't crash. I'm thinking that crashing a recursive routine is dependent on your computer's configuration. I may need to crash to find the limit my computer has with Recursion.