>>Recursion is dangerous but not impossible to manage. Like a skilsaw, very efficient if used properly, just be careful not to cut off your hand! :)
>
>What is the danger? This is exactly the scenerio to use recursive calls.
The danger of recursion is not properly terminating it, and overflowing the call stack (or in FP/VFP getting "DO nesting too deep".)
I was quite specifically saying that recursion is useful, and should be used in certain situations (this being one of them). Only adding that there are inherent dangers to recursion. I'm not afraid of recursion, I've often used a recursive solution to a problem where my colleagues (or classmates in college) didn't see it.
As with many tools, recursion is very useful but must be used with proper caution. Like I said, like a skilsaw. Or a car. Or a firearm.
Cheers,
Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing