realbasic-nug
[Top] [All Lists]

Re: Copying a folder

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Copying a folder
From: Austin Clow <dr_clow at mac dot com>
Date: Sat, 31 Jul 2004 14:42:40 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <1BCCA794-E326-11D8-9EFE-00039369B326 at kellerfarm dot com> <E7C2F7A3-E326-11D8-9179-000A959FF9F8 at mac dot com> <1AFFF01A-E329-11D8-9EFE-00039369B326 at kellerfarm dot com>
no no no

you need to use

dim i,c as integer
dim j as FolderItem
c=j.count


//if you are moving the files from the folder j then you need to use

for i=1 to c
f=item(1)
next

//if you are not moving the items out of j then you need to use
for i=1 to c
f=item(i)
next

the reason for this is because if you move the item out of the folder "j" then the item will be gone and the count will no longer be equal to the first time you said count it will get smaller each time it passes through the loop. Ever time the loop passes one time it recalculates j.count. so if you set it to c which was set out side of the loop it will not recalculate it. You should always do this anyways.

On Jul 31, 2004, at 2:37 PM, Andrew Keller wrote:

I read somewhere that folder.item(0) is the parent folder. I'm not sure if that's true, but if it is then if you access that, it might be the problem.

I'm using:

Dim j As Integer
Dim f As Folderitem
// lots of code excluded
For j=1 to f.Count
  ...
Next

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

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>


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

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

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