Ausgeschlafen geht das wirklich besser
Delphi-Quellcode:
procedure Tlft.ReadWriteSubnodes(inNode, targetNode : TTreeNode; active : boolean = false);
var
newNode : TTreeNode;
begin
while inNode <> nil do
begin
if inNode.HasChildren then
begin
newNode := assignmentsTree.Items.AddChild(targetNode,inNode.getFirstChild.Text);
ReadSubnodes(inNode.getFirstChild,newNode,true);
end;
if active then
begin
inNode := inNode.getNextSibling;
if inNode <> nil then
begin
assignmentsTree.Items.Add(targetNode,inNode.Text);
end;
end
else inNode := nil;
end;
end;