Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do Factorials in VFP with Recursion
Message
De
22/02/2000 07:42:23
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
 
 
À
22/02/2000 00:20:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00335196
Message ID:
00335301
Vues:
20
>Probably its most common use is to go through all the nodes of a tree/hierarchy (traverse a tree). Like when you need to process all the files in a directory tree.

I recently wrote a recursive program to mimic the deltree command. (delete files, recursively delete sub-dirs, remove the now-empty directory)

It is fast and code efficient. I learned the hard way though that the ".." directory can cause some grief- I wanted to remove c:\delme, where the filesystem lists ".." as the parent directory. The code ran on the parent (root of c:) and it effectively deleted everything on my hard drive! It stopped on an in-use windows file, but i learned how many more windows critical files weren't in-use (and therefore gone) when i tried to reboot later.

I don't know what table-like data would be modelled with a directed graph, but recursion is an efficient way to traverse a graph too... (at least that was the example we used for recursion)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform