Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Friday afternoon toughie - tree endless loop
Message
From
03/02/2019 13:15:20
 
 
To
01/02/2019 19:35:13
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01665871
Message ID:
01665881
Views:
61
Hi Al,

I knew someone here would think of something - I think you have seen the holy grail through the trees (to mix metaphors/movies). I already have a function GetTopMostParent_ID that looks upwards parent by parent until it hits a parent with no parent id itself. I could modify that function or create a new one that just does a "check".

Or better yet, I could write a function that also keeps an array of the parent id's as it loops upward and as soon as I hit the same parent twice, I must be in a loop.

Thanks!

>
>One way to structure lists like this is to have top-level entries that have no parents. If you've done that you could "walk" through the parents of the candidate node (CN) that is about to be changed. If you eventually hit an empty parent, then OK. If you hit CN, then you have a loop and you disallow the change.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform