B
Bas Cost Budde
Jason said:Hi bas,
Thnx for the effort, i could be finished by now . But that's not the
point. I still want to learn how it can be done. Tim also replied to this
subject and has an example code. Could you take a look at it?
Thanks Tim.
public sub GetSubDirs(strRoot)
do while len(dir())>0
AddItToArray
loop
for each strDirName in MyArray
GetSubDirs strDirName
next strDirName
End Sub
Let's see.
This routine calls itself, after having finished with the current
directory, for every subdirectory. An initial dir("pathname",
vbdirectory) is assumed. AddItToArray must be written, and should use
the MyArray mentioned furtheron.
I wish to announce I got plain files inbetween my directories. Using the
vbDirectory constant!
Now I'm getting stuck on termination of the algorithm. In the above
fragment, For Each is used, and inside that loop the size of the array
can (will likely) grow. I never tested what will be looped through then.
And what will the second level recursion try to do? Scan the directories
again?
I'm sorry to say I cannot provide a complete answer for this. I don't
have such a setup to run full-scale tests, and I don't want to spend
time to build a test environment, so to say, there are projects I have
to finish too.
I will keep it in mind.