Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing an error
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Changing an error
Divers
Thread ID:
00413131
Message ID:
00413131
Vues:
44
Hi all;

I am trying to figure out how to trap an error in a class (error 3, file is in use), and then raise a custom error that gives the user a better explanation. I don't want to use a messagebox or anything like that. This is a business level class, and I really like to keep interface out of it if possible.

Unfortunately, if I put code such as:
IF tnError = 3
   ERROR "Cannot close all of the old data files ..."
ENDIF
inside the error method, the error I raise gets handled directly by VFP, with a dialog with Cancel, Suspend, Ignore and Help buttons. There are error methods in the superclasses, and there is an ON ERROR error handler set up. But apparently an error inside an ERROR event method is untrappable.

Any ideas how to get around this, still using an error for my method of communicating?
Jim Munn, MCSD
Visual Data Solutions
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform