So, with further testing, it seems even the basic recursion technique I
copied off the web isn¹t working either.

Here¹s the code:

  sourceFolder = SelectFolder
  if sourceFolder = nil then return
  
  // Add rootFolder to stack
  folders.Append sourceFolder
  
  // For each folder in the stack
  while UBound(Folders) > -1
    // Get the folder at the top of the stack
    currentFolder = folders.Pop
    
    // For each item in the current folder
    for index = currentFolder.Count DownTo 1
      itemInFolder = currentFolder.Item(index)
      if itemInFolder <> nil then
        
        // If item is a folder
        if itemInFolder.Directory = true then
          // Add folder to the stack
          folders.Append itemInFolder
          
        else
          // Add file to the listbox
          sourceName = sourceFolder.Item(index).Name
          sourcePath = sourceFolder.Item(index).AbsolutePath
          SourceList.AddRow itemInFolder.Name
          sourceDict.Value(sourceName) = sourcePath
          
SourceList.Cell(SourceList.LastIndex,1)=ReplaceAll(sourcePath,":","/")
        end if
        
      end if
    next
  wend

I added the absolutepath, and made a couple of other changes as advised
here, such as removing the () from selectfolder. But everything else is how
I got it off the web. It was a tutorial at ResExcellence,
http://www.resexcellence.com/realbasic/articles/2003/10-21-03/

So when working with larger folders, and stepping through each iteration, I
now see that it is wholly inaccurate, duplicating some filenames many times,
and rarely getting the absolutepath right.

So I¹m pretty much lost.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to