Solved

Treeview items

Posted on 1997-04-21
2
213 Views
Last Modified: 2010-04-04
I have a file of strings like c:\acad\j\loop\unit-30.  I would like to build a tree from them without duplicating any nodes. The first node would be "c:", the second would be "acad" and so on.  The next string would be "c:\acad\j\loop\unit-31".  I don't want to have another level 1 node of "c:", In this case I would just like to add "unit-31" to the loop node as a child.
0
Comment
Question by:DPomeroy
2 Comments
 
LVL 3

Accepted Solution

by:
mheacock earned 50 total points
ID: 1335605
You atart at level one all the time...compare c: to everything at level one, if it exists, then go to level two off of that node, if it doesn't exist, then add it.  At level two you check to see if there is already a level two that matches the level two you are looking for, if so, then go to its level 3, if not add it.
0
 

Author Comment

by:DPomeroy
ID: 1335606
I can't figure out how to do the compare.  Do I you something like this.  If CurrentSubdirectory (c:) <> treeview1.node.text then addchild(CurrentSubdirectory)?  I still can't figure out how to access the properties of the class and what properties there are.  Also I can't figure out how to do the methods and I think I should be able to make a new class and add some more properties and methods.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
indy Tmemory stream non latin charcter issue 2 110
Delphi application Soap connection 5 103
Delphi XE10 Round Image 2 121
How to build JSON File in Delphi 6 3 32
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question