Doug,
You may use recursion, if you're calculating a determinant. I created a recursion-based program in VB...
BTW, it's a well-known fact, that each recursive program could be done in non-recursive way too.
>>May I say that factorials are the best example for where to not use recursion?
>
>Absolutely!! I think these kinds of threads bring light to all.
>
>>Here's a much simplier, faster
>>and cmore compact version: <g>
>
>Show off! *bg* (he says as he harrumphs and sulks into his corner *g*)
>
>>
>
func Factorial
>lparam tnNumber
> local lnResult
> lnResult = 1
>
> for lnI = 2 to tnNumber
> lnResult = lnResult * lnI
> endfor
>
>return lnResult
>
>Best regards,
>
>DD
If it's not broken, fix it until it is.
My Blog