Building a directory tree (From Bill's respon

Results 1 to 2 of 2

Thread: Building a directory tree (From Bill's respon

  1. #1
    Join Date
    Dec 1969

    Default Building a directory tree (From Bill's respon

    (Brought this from the other thread, it was getting very long)<BR>Bill, <BR><BR>OK, I see what you are saying and I was having that problem awhile ago, but I am now getting the level *live* each time I need it(not using an incrementer, but actually using .ParentFolder to go up the tree and get it that way. <BR><BR>I have placed the source code on my server along with a working version. They can both be accsessed here: <BR> <BR><BR>I appreciate you taking a look, at first glance of your suggestion, I don&#039;t think that is the problem that I am having, hopefully seeing all my code and the demo will help make my case a little better, in the meantime I will go over your suggestions again and see if I understand them differently. <BR><BR>When(if) you take a look at the demo, take not of the problem that I am having with folder: "missing graphics" notice how there is no lines connecting it with: "I cannot think of anything to call this"? That&#039;s where I am stuck.... can&#039;t think of a way to handle that situation..... sorry the source isn&#039;t color coded... that would take too long ;) <BR><BR>Hope you take a look, <BR><BR>Thanks again, <BR><BR>Steve

  2. #2
    Join Date
    Dec 1969

    Default Ugh...I see what you mean...

    First of all, I do *NOT* like your GetLevel function. It seems horribly inefficient to me. Ummmm...let me rephrase that: Actually, I&#039;m impressed with how well the function does its job, but I don&#039;t like the fact that you *need* the function. I still say that passing the level number and level info "on the fly" as you descend is the better way to go.<BR><BR>I think the trick here is going to be to pass an *ARRAY* of level info, instead of just a level number, from one level to the next.<BR><BR>So that, by the time you are processing that "Help" folder, your array knows:<BR><BR>There are 4 levels above itself<BR>Level 0 ("root") has more items to go<BR>Level 1 ("Steve") does NOT have any more items to go<BR>Level 2 ("This is a folder that has other folders") has more items<BR>Level 3 ("I cannot think of anything to call this") is the direct parent and has one more item to go<BR><BR>Maybe just an array with the count of items to go at each level? I guess that could be a global, then the level counter is the local variable. And as you processed each item you decrement the number in that level of the array?<BR><BR>Take this offline?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts