Le 31 mars 09 à 20:18, Brad Rhine a écrit :
On Mar 31, 2009, at 2:09 PM, Kimball Larsen wrote:
dim f as FolderItem = specialFolder.Temporary.child("ah")
dim f2 as folderItem
dim i as integer
for i = 1 to f.Count
f2 = f.item(i)
f2.Delete
next
f.delete
Change this:
f2 = f.item(i)
To this:
f2 = f.item(0)
Makes sense when you think about what the computer is actually doing.
But be prepared to handle cases where a file cannot be deleted (in
that case, you skip it and increment the integer by 1).
However, it's simpler to use a backward loop:
for i=f.count downto 1
because, even if a file cannot be deleted, you skip it automatically
(without even having to check if the file was successfully deleted).
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|