>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:
>
>
>
>* 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.