Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete File Errors
Message
From
26/04/2005 09:20:21
 
 
To
26/04/2005 08:42:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01008399
Message ID:
01008418
Views:
16
>Since Delete File does not return any value what is the best way to trap for errors when Delete File fails?

TRY .. CATCH .. ENDTRY or a dummy ON ERROR routine before the delete and reset the ON ERROR afterwards.

Update: for VFP6 it will have to be the dummy ON ERROR option:
ON ERROR lDelFailed = .T.
lDelFailed = .F.

DELETE FILE (somefile)

IF lDelFailed 

  * delete failed

ENDIF
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform