New topic: 

FolderItem Delete Difference When Debugging

<http://forums.realsoftware.com/viewtopic.php?t=36456>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        alakazam          Post subject: FolderItem Delete Difference 
When DebuggingPosted: Sat Nov 27, 2010 3:04 pm                         
Joined: Tue Nov 15, 2005 8:18 pm
Posts: 270
Location: Alaska (and more!)                I have a program that creates a 
folder in SpecialFolder.Temporary and then copies a bunch of files in there to 
be used by another app.

The next time (same session) the files are copied, I delete all of them in that 
SpecialFolder.Temporary folder, trash the folder, and recreate everything.

The problem is that some of the files are not being deleted. But when I step 
through in the debugger all files are deleted. Run at full speed, 3-4 of them 
are left. This is my delete code:
Code:dest = SpecialFolder.Temporary.Child(str(App.CurrProjectId))
  for x = dest.Count DownTo 1
  dest.Item(x).Locked = false
  dest.Item(x).Delete
  if dest.LastErrorCode > 0 then
    msgbox str(dest.lasterrorcode)
  end if
  next
  dest.Delete
  end if
I never get an error from LastErrorCode even when the files are not deleted.

If I put a breakpoint right after that code and check, some files are left 
behind. If I step through that loop, all files get deleted.

Any ideas? I'm using RB2009 r5.1 on a new iMac.

 Jay Jennings      
_________________
---------------------------------------
New 2010 Tutorial Videos for REALbasic!
What's your most burning question about programming in RB?
RB Tutorial Videos - Ask Your Question Here!  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to