On Tue, 15 Jun 2010 11:05:34 +0300 Juha Manninen <[email protected]> wrote:
> Hi > > Is there a cleaner way to iterate TStringToStringTree? This is the > codetoolsstructs version but the LCL version is almost the same. With fpc 2.5.1 you could write an enumerator: http://wiki.lazarus.freepascal.org/for-in_loop > var > MapToEdit: TStringToStringTree; > Node: TAVLTreeNode; > Item: PStringToStringTreeItem; > begin > ... > Node:=MapToEdit.Tree.FindLowest; > while Node<>nil do begin > Item:=PStringToStringTreeItem(Node.Data); > > // *** use Item^.Name and Item^.Value *** > > Node:=MapToEdit.Tree.FindSuccessor(Node); > end; Mattias -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
