On Fri, 04 May 2007 16:22:36 +0200
Darius Blaszijk <[EMAIL PROTECTED]> wrote:
> Ok thanks, I will look if I can steal some code from there ;)
>
> Darius
>
> Vincent Snijders wrote:
> > Darius Blaszijk schreef:
> >> Hi,
> >>
> >> I have problems understanding how to traverse a CodeTree. The code
> >> I'm talking about is pasted below together with the testunit I
> >> parsed.
> >>
> >> The result I get from the code is:
> >>
> >> 4 Unit
> >> 5 Interface Section
> >> 16 Uses Section
> >> 6 Implementation
> >>
> >> I would expect though that I would also see the items behind the
> >> implementation section. How can I access them?
> >>
> >> Darius
> >>
> >> CodeNode := CodeTool.Tree.Root;
> >> repeat
> >> WriteLn(Format('%d %s', [CodeNode.Desc, CodeNode.DescAsString]));
> >> CodeNode := CodeNode.Next;
> >> until CodeNode = nil;
> >>
> >
> > Do you have more complete code. The code explorer does it, so you
> > should be able to do it too.
The CodeNode.Next travels through all nodes. For example the uses
section is a child of the interface.
The problem is probably, that you told the codetools to only parse the
interface. There is a flag in CodeToolBoss.Explore for this.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives