On Mar 23, 2006, at 11:36 AM, Jeffrey Ellis wrote:
Hi, Joe--
I'm now having (what appears to be) one last problem before this
thing is
done.
Basically, I was getting a nilobject in a strange place. I had
copied the
code for the method I used directly from the LR, CopyFileOrFolder.
Here's
the code (this is the second to last example from the FolderItem Class
subject) :
Sub CopyFileorFolder (source as FolderItem, destination as FolderItem)
Dim i as Integer
Dim newFolder as FolderItem
If source.directory then //it's a folder
newFolder=destination.child(source.name)
newFolder.createAsFolder
The problem is either with the way you are calling this method, or
the way it's implemented depending on your point of view. The nil
object is occurring because the line: newFolder=destination.child
(source.name) is trying to create a folderitem inside a folderitem
that doesn't exist. There is no need to create the folder name as a
child since destination is already a folderitem pointing to the
folder that needs to be created.
try this small change
newFolder=destination //.child(source.name)
I haven't tested extensively, but I think this should do the trick.
HTH,
Kevin
_______________________________________________
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>