The first problem I see is that the code uses Item, which resolves
aliases, instead of TrueItem. If this code encounters an alias,
strange things will happen. Otherwise I'm lost as well; I have no idea
what it is you're trying to do. Perhaps you could explain that first.
Charles Yeomans
On Mar 20, 2006, at 3:27 AM, Jeffrey Ellis wrote:
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>