Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling problem - Help!
Message
From
11/06/2002 20:21:35
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00667122
Message ID:
00667166
Views:
25
Michael,

Add two properties to the form, called lErrorOccurred and lSuppressError. In the error() method of the form, you can do as you suggested and trap the specific error.

The following code bypasses the error routine in Codemine. Hopefully something like this will work in your situation.
* formMethod1() method
thisform.lErrorOccurred = .f.
thisform.lSuppressError = .t.
x = "a" + 5  && this will throw an error, but will continue on...
thisform.lSuppressError = .f.

if thisform.lErrorOccurred
   activate screen
  ? program(),"Houston, we have a problem!"
endif
* end of method

* form.error() method
LPARAMETERS nerror,cmethod,nline

if !this.lSuppressError
    return dodefault(nerror,cmethod,nline)  && call Codemine form.error() method
else
    * trap for specific error here, and call dodefault() if necessary
    thisform.lErrorOccurred = .t.
endif
>The code is within a method of an object on the form - and yes, I'm doing it for someone else who has CodeMine.
>
>>Michael,
>>
>>Where is this code? Is it in a form method or within a method of an object on a form?
>>
>>Are you trying to solve this for someone else who has Codemine?
>>
>>I am running Codemine, and I'm willing to help out...
>>
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform