Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00662861
Message ID:
00663171
Views:
17
Your code will work fine if you just declare llError first:
LOCAL llError

llError = .F.
I do exactly this in my DB_EXCL function. If you want to compare code, you can download DB_EXCL from www.peisch.com/downloads.html.

>Hi,
> I have a function in prg file. It responsible to loop thru all tables of opened database and USE it exclusively. It any of them failed, it will return .F.
> I place
ON ERROR llError = .T.
before I try to
USE mytable EXCLUSIVE
>
> I have declare
LOCAL llError
My problem is, llError always is epual to .F. I found that ON ERROR will create llError as public and refer to it instead of my local llerror. Why?
>
> To continue my work, I remove my statement LOCAL llError from the procedure. It works fine if I call it from command window. However, once I call this function from form.method, form.error() will be fired everytime if USE failed. How could I force VFP to not use ON ERROR to handle error instead of FORM.error()?
>
>Thank you
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform