>
> Ok, maybe I can approach this in a different way.
>
> As I go through adding files to the dictionary, I am also adding them to the
> two listboxes, one for Source, the other for target.
>
> The missing files in each are still in the other. So after searching the
> dictionary and finding a missing key value, it exists not only in the other
> dictionary, but also the other listbox.
>
> Is there a way to retrieve the Path information for that key value from the
> listbox -- where it's still correct? I.e., can I do a lookup on the listbox
> without having to step through every entry to find the filename that is the
> missing key value, and then retrieve the data from the cells in that row?
>
> Thanks again :)
>
> All My Best,
> Jeffrey
I've now checked my dictionaries, and here's what I saw.
Each iteration through my initial loop, I do an addrow to the listbox, and a
Key/Value to the dictionary. The key being the folderitem.Name and the value
being the folderitem itself.
However, when run in the debugger, I see that the listbox has added 3900
rows of files, but there only 234 entries in the dictionary.
As well, although the folderitem's aboslutepath is accurate, virtually all
the values in dictionary for *any* key, are all the same path, to the same
file.
Yet when I step through the code, there are the same number in both the
listbox and the dictionary and the folderitem's absolutepaths are correct in
the values at least until I get too tired to keep pushing the step button.
So I guess my question is...
WTH??
This is RB 5.5.5.
Here's the code which adds to the listboxes and to the dictionary:
//Get the folder
sourceFolder = SelectFolder
if sourceFolder = nil then return
sourceCount = sourceFolder.Count
// 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) = itemInFolder
SourceList.Cell(SourceList.LastIndex,1)=ReplaceAll(sourcePath,":","/")
SourceList.Cell(SourceList.LastIndex,2)=getPermissions(itemInFolder)
end if
end if
next
wend
_______________________________________________
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>