Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with recursive function
Message
De
03/12/2003 19:39:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
03/12/2003 19:30:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00855676
Message ID:
00855679
Vues:
14
>I need some help creating a little recursive routine. I have a table that i want to have look like this
>
>
>department   parent       level
> 1             --           1
> 2              1           2
> 3              1           2
> 4              2           3
> 5              2           3
> 6              3           3
> 7              3           3
>
>The table is created from the below tree.  But only the department and parent are filled in:
>
>
>                          1
>
>                        /    \
>                      2        3
>                     / \      / \
>                    4   5    6   7
>
>
>
>I believe I need some sort of recursive routine that will scan the table and fill in the level column based on the above tree.
>
>Any help greatly, greatly appreciated,
>
>Thanks,
>
>Perry

How do you access the tree data, from which you want to create the table? Another table, with a different structure?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform