Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling problem - Help!
Message
 
À
11/06/2002 20:21:35
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
00667122
Message ID:
00667432
Vues:
29
Steve:

So, I should override the error at the FORM level, rather than down in the object performing the action that caused the error? Is that how error handling in VFP usually works - from the top down? If so, that was the gap in my understanding...

TIA
Michael

>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...
>>>
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform