If the parameter s is a path, then GetFolderItem already does this --
dim foo as FolderItem = GetFolderItem(thePath,
FolderItem.PathTypeShell).
But perhaps you have other reasons for implementing it yourself.
Charles Yeomans
On Mar 24, 2006, at 6:17 PM, Jay Rimalrick wrote:
FolderItem Child() creates slow code
I wrote a function shown below that creates a folder
item from a folder item and a string. The code runs
real slow when I use it in a loop. I assume it is
because the Child() method calls are slow? Does
anybody know why this code is slow and how I can make
it faster?
Function StringToFolderItem(f as FolderItem, s as
String) As FolderItem
dim outF as FolderItem = f
dim last as integer = CountFields(s,"\")
for x as integer = 1 to last
outF = outF.Child(NthField(s,"\",x))
next
return outF
End Function
Thanks,
Jay
_______________________________________________
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>