The best object to use (without using recursion of a sub procedure) would be a "Queue" object. Basic, values go in one end, and come out the other in the order they origionally entered. With the right tweaking for your app, the following will work until it exhausts all routes without duplication.
OK, let's assume your list is an array of strings, will call it dirrectoryArray()....
Dim searchQue As New System.Collections.Queue(d
'Fill up the queue with the values (re-write for your app...)
Dim s As String
For Each s In dirrectoryArray
searchQue.Enqueue(s)
Next
'Define a string to hold values taken from the queue
Dim dirToSearch As String
While searchQue.Count > 0 'Do until the queue is empty
dirToSearch = CType(searchQue.Dequeue(),
'Test for starting with "d"
If dirToSearch.StartsWith("d"
'Search this directory here for more directories...
'Here's where whatever you wrote comes into play...
'That's why this is abstract...
If FoundAnotherDirectory Then
searchQue.Enqueue(TheFound
End If
End If
Main Topics
Browse All Topics





by: andrewpkPosted on 2004-11-19 at 15:33:15ID: 12631021
you'll need to design a recursive procedure, that will just traverse your directory structure you're using for the search...
aka..
c:\ (search for directories)
find c:\apps
enter c:\apps and search for more directories
after finishing, return to c:\ and search for more
may I ask what you're doing with the directory names?
also correct me if i'm not understandign it right.
Andrew