Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do Factorials in VFP with Recursion
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00335196
Message ID:
00335224
Vues:
13
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform