realbasic-nug
[Top] [All Lists]

Re: A quick question about folderitem.movefileto

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: A quick question about folderitem.movefileto
From: Charles Yeomans <charles at declareSub dot com>
Date: Thu, 31 Jan 2008 18:49:06 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <f72ec0cb0801311527n14a79001ib02485f759c53d4b at mail dot gmail dot com>
On Jan 31, 2008, at 6:27 PM, Paul Rehill wrote:

> If I move all the files in a folder to another folder using
> folderitem.movefileto, is it best to cycle through a loop from the
> last item count to 1
>
> For j = iCountFoldItems downto 1
>   SomeFolder.Item(j).movefileto SomeFolderElsewhere
> Next
>
> Counting the other way doesn't seem to work as it appears half the
> folderitems get moved as the item numbers of the files yet to be moved
> decrease accordingly.
>
> Is this right?


I prefer the following.


Function Items(extends f as FolderItem) as FolderItem()
   dim theList() as FolderItem
   for i as Integer = 1 to f.Count
     dim f as FolderItem = f.Item(i)
     if f is nil then
       continue
     end if
     theList.Append f
   next
   return theList
End Function

for each item as FolderItem in parent.Items
   item(i).MoveFileTo Somewhere
next

Charles Yeomans
  
    
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>