Tree problem


if all you have it a list of items & their paths instead of an actual tree then you dont have a lot of choice but to build a tree

you’ll want some kind of “tree node object” that can hold a reference to the class/module that you read
and it also need to have an array of references to the classes / modules it contains

Class node
       myObjectReference as object
       myContents() as object
end class

And then a “project” is just an array of these nodes (since it may have many top level items that contain other items)

Another approach is to just have a giant flat list and track the ID’s and the “contained by ID” and a way to find all those very quickly when a hierarchical node is expanded

edit : something like this

Thanks Norm. As usual your solution is always the best one!

Finally got it all figured out. Getting a good night’s rest no doubt helped as well.

For what it’s worth, the Xojo Project file format is bonkers! Reverse engineering it is a pain in the ass.

1 Like

Ask :stuck_out_tongue:
The upside to NOT actually building a tree is one problem that arises often in the actual IDE
If an item is “contained by” something it hasnt encountered in the manifest yet an actual tree structure WILL have issues
This one, a flat list with cross indexing, can handle it and then the items that dont have proper parents can still be retained AND “fixed”