Recursive functions - نوشته شده در (1374 Views)
Development Team Member
Davio
مطلب: 12217
12217
Anyone here have experience using recursive functions in ASP?
It's basically a function that calls itself, each time sending different values. So it's like a loop.
I am assisting someone here with a file upload mod and ran across the function calling itself to look through the folders and subfolders.
It's the first I have run into recursive functions in my years of coding so it's a little hard to grasp.
I am hoping one can replace this function with a loop?
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
Recursiveness can't always be handled with a loop, at least not as easily. The difference is that in each fucntion call you are, in fact, providing a new context, so recursive functions are a neat way to handle complexity. Going recursively through folders is such a situation...
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
I use them pretty extensively in JavaScript but don't think I've ever had need to use them in ASP. Now I know they're possible, though, I'm sure I'll find some use for them! wink
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
I use recursive functions all the time in .net and most other languages for that matter, they are generally the best way to accomplish complex iterative processes especially when the structures are tree like in nature
نوشته شده در
Development Team Member
Davio
مطلب: 12217
12217
Wow. Ok. 10 years coding and never run into recursive functions. But then again, Snitz Forums has been my teacher. lol
 
شما باید یک متن وارد کنید