Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Friday afternoon toughie - tree endless loop
Message
De
03/02/2019 13:21:18
 
 
À
03/02/2019 06:34:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01665871
Message ID:
01665883
Vues:
51
Hi Gregory,

Thanks - I got thinking along those lines after seeing Al's comment from Friday night - I think the solution #1 would be the easiest to implement. I already have a function called GetTopMostParentID() that I could modify to keep track of which parent_IDs have been processed so far and if I hit a duplicate, to trigger an error (or create a new function to do the same).

Question: what would a candidate index look like and how would I use it? Just wondering where you are going with that.

Albert

>
>(1) "related companies processor"
>The way to avoid the loop is to keep track of the ParentCoID's which you have processed so far. If you are about to process a ParentCoID that has been processed before, you are about to enter a cycle (loop)
>
>(2) It would help to have a candidate index on Company_id since an office can not be a branch (child) of more than one head office (parent)
>
>(3) To detect a potential cycle when the user changes a node. Process downwards depth first, keeping track of all the ParentCoID processed so far. If you are about to process a ParentCoID that has been processed you have a cycle
>That cycle is either a cycle that the user is about to introduce, or a cycle that was already present
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform