realbasic-nug
[Top] [All Lists]

Re: FolderItem.delete Oddities?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: FolderItem.delete Oddities?
From: Arnaud Nicolet <anic297@mac.com>
Date: Tue, 31 Mar 2009 20:32:26 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <17F18A03-1294-428B-8AAF-BD4F6D381944@kimballlarsen.com>
References: <E14D1190-E2BE-4E5A-BD5A-56B5ED3032EC@kimballlarsen.com> <58E76433-7F2A-4FBF-B989-53C923365DB2@oofile.com.au> <17F18A03-1294-428B-8AAF-BD4F6D381944@kimballlarsen.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Le 31 mars 09 à 20:28, Kimball Larsen a écrit:

Except that item() is a 1-based array, so you need to use item(1).

Oh, and I changed it to use a while loop instead of a for:

 dim f as FolderItem = specialFolder.Temporary.child("ah")
 dim f2 as folderItem
 dim i as integer
 while f.count > 0
   f2 = f.item(1)
   f2.Delete
 wend
 f.delete

Works fine now, thanks!

And what if, for whatever reason, one of your file can't be deleted (e.g the user locked it)? Then you get an endless loop.
_______________________________________________
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>