Thanks Joe and Chris,
That was the problem
I prefer Joe's suggestion to combine the two lines
S = File.OpenAsTextFile.ReadAll
Thanks again.
Lennox.
Joe Strout <joe at inspiringapps dot com> wrote: On Feb 29, 2008, at 7:41 AM,
Lennox Jacob wrote:
> 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
The Delete call here fails because you still have the file open (via
TIS). Add "TIS = nil" after the TIS.ReadAll, and it should work.
(Or, just combine the two lines to S = File.OpenAsTextFile.ReadAll...
and either way, you should be prepared to catch an exception if the
file can't be opened.)
Best,
- Joe
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
Search the archives:
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|