realbasic-nug
[Top] [All Lists]

Re: Help please: Why aren't these files deleted?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Help please: Why aren't these files deleted?
From: M Pulis <toothpic at fastq dot com>
Date: Fri, 29 Feb 2008 08:03:17 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <114788 dot 21527 dot qm at web65405 dot mail dot ac4 dot yahoo dot com>
What is the value in LastErrorCode?


Gary


On Feb 29, 2008, at 7:41 AM, Lennox Jacob wrote:

> Hello,
>
> I have the following code in a pushbutton. When the pushbutton is  
> pushed (the name of the folder is in EditField1), the files to be  
> deleted comes up in the message box and the total number of files  
> deleted also comes up, but the files are not actually deleted.
>
>   Dim TIS as TextInputStream
>   Dim TOS as TextOutputStream
>   dim f, File As FolderItem
>   dim i,j As Integer
>   dim S As string
>   Dim DeletingFilesFolderName as string = EditField1.Text
>   f=DocumentsFolder.child(DeletingFilesFolderName)
>   j=0
>   for i=1 to f.Count 'Every file in the folder
>
>     File=f.trueItem(i)
>     if File<>nil then
>       If File.name.left(3) = "200" then
>
>         TIS = File.OpenAsTextFile
>         S = TIS.ReadAll  // Open the file and start reading and  
> input the lines as the come
>
>         if Trim(S) = "" or Trim(S) = chr(13) then
>           msgbox File.Name + " deleted"
>           File.delete
>           j=J+1
>         end if
>
>       end if
>
>     end if
>   next
>   msgbox str(j) + " files deleted from folder " +  
> DeletingFilesFolderName
>
> Why aren't these files deleted?
>
> Thanks.
>
> Lennox
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals?  Find them fast with Yahoo!  
> Search.
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
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>