View Single Post
  #2 (permalink)  
Old February 27th, 2009, 07:40 PM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Doesn't make sense.

You are in an INFINITE LOOP there.
Code:
while n.hasChildNodes
You never break out of that loop and you never change the value of n inside the loop.

Also, since you are using recursion you *MUST* DIM each of the variables that are local to each occurrence of the recursion INSIDE the SUB.

That would mean
Code:
Sub Drill(n) 
    Dim chd, cld1, att
    ...
Finally, you are not checking to be sure that some of those values *exist* before you use them! For example, you do
Code:
for each att in cld1.attributes
But you *WILL* get an error if cld1 doesn't HAVE any attributes!
Reply With Quote