Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locfile()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00119369
Message ID:
00119660
Views:
17
>>>The Locfile() command returns a VFP error if you click CANCEL, instead of a null string or other "This didn't work" value. I *can* use Getfile(), although I would prefer Locfile() for a specific use. Any suggestions other than disabling our standard error handler before the call, trapping for this error and then re-enabling the error handler?


I am not sure this would work since I don't know how your error handleing works, but I assume you are using on error global error handler.

Well, in VFP each object has a method, when an object creates an error VFP goes up the container hierarchy and if it finds no code in any error methods it will use the on error setting.

So, perhaps on the form, or in the object you use LocFile() you could handle that specific error. If the error is not the one that mean LocFile Canceled() you can call your error handler explicitly.

(In 6.0 you could cause the error again with the ERROR keyword)

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform