Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insuffient Stack Space
Message
De
17/05/1998 22:21:29
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00084835
Message ID:
00100026
Vues:
111
>Justok,
>
>If I remember my compiler theory class, every recursive algorithm can be expressed in non-recursive code. But where an algorithm can be expressed recursively the code is typically more "elegant". Here's one from my toolbox of debugging code:
>
>
* FullName.prg  13-Jun-95
>
>* Generate an object's full containership name
>
>* 03-Dec-95 added additional validity testing
>* 26-Apr-96 added testing to handle _VFP object which is its own .Parent
>* 15-Jan-98 used IsObject()
>
>function FullName( roObject )
>
>if ( IsObject( m.roObject ) )
>   if ( ( type( "roObject.Parent" ) == 'O' ) and ;
>        ( roObject.Name != "Microsoft Visual FoxPro" ) )
>      return ( FullName( roObject.Parent ) + "." + roObject.Name )
>   else
>      return roObject.Name
>   endif
>else
>   return ""
>endif

>
>And if it wasn't for the error checking code the above stuff would show it's simplicity.
>
>>Oh.... I nearly forgot Recursion because I can use simple SQL command or
>>control loop instead of it. But I really want to know, is there any cases
>>need to program it in recursion?!

Good Code, is it the same as SYS(1272, ObjectName)??
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform