On Oct 19, 2006, at 8:48 AM, Carlo Rubini wrote:

I'm having some problem when, parsing nested folders in win32 environment, the loop encounters a shortcut referring to a folder that does not exist anymore. Meantime, I noticed that even if the icon of such shortcut is that of a folder, the shortcut itself is a file with the extension .lnk

No use to say something like: if f.item(i) <> nil and f.item (i).exists then doSomething; because f.item(i) will go through the loop and generate the following system-message: "The drive or network connection that the shortcut 'foo.lnk' refers to is anavailable. Make sure etc etc."

The workaround that at present works for me is to do this:

for i = 1 to f.count
  if f.item(i).directory then
     //do recursion
  else
     f = f.item(i)
//I even tried adding: f = f.parent.child(f.name) but it is an unecessary step
    //do something with f
  end if
next

So here is my question: is there a simpler way to block a dead shortcut?
(Sorry, but I'm not a windows man).

Probably you should use f.TrueItem instead of f.Item.

Charles Yeomans

_______________________________________________
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