Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do Factorials in VFP with Recursion
Message
 
To
21/02/2000 23:49:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00335196
Message ID:
00335224
Views:
14
Have to agree Vlad,

It's harder to run into the procedure nesting limit your way too.

Cheers,

Andrew


>May I say that factorials are the best example for where to not use recursion? Here's a much simplier, faster
>and cmore compact version: <g>
>
>
func Factorial
>lparam tnNumber
>local lnResult
>lnResult = 1
>for lnI = 2 to tnNumber
>   lnResult = lnResult * lnI
>endfor
>return lnResult
>
>Vlad


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform