Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling problem - Help!
Message
De
11/06/2002 20:21:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
00667122
Message ID:
00667166
Vues:
24
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform