Dan Kloke wrote: > i dont get why theres an assignment to the nodes array in the middle of > this, so maybe i dont get what youre doing here. it looks like the > nodes:PObjArray array is being changed by the counting process.. that > cant be a good idea.
But that's the entire purpose of the function. It scans the tree and accumulates all the matching nodes into the array -- hence the name of the function, ExtractNodes. The Count value is used not only to count how many items there are, but also to denote the next empty spot in the array, so the function knows where to store the next matching node. Thus the count can't simply be a function return value since it also needs to be an input parameter indicating how full the array already is. -- Rob __________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk
