Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling property?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00225694
Message ID:
00225731
Vues:
14
Terry,

A couple of issues to think about.

1) if you put a property/method in your form and the button needs you are tightly coupling the button class to the form class. That means that those buttons will only work on forms derived from that form class. If you put it in your lowest level form class then it might not be that much of a restriction.

2) If the button Error() method is firing it's because the other object didn't have an overridden error method anywhere along it's class tree. Personally I think it's best for each object to handle it's own errors. I enforce this in my own classes by putting this code in every one of my lowest level classes:

ObjError( this, nError, cMethod, nLine )

This delegates the error to a generic UDF. If I have an object that can expect to have trappable errors that I can't pretest and prevent I put code in that object's Error method to handle it

>I often give my command buttons the job of initiating some form method or object method, and the job of indicating completion of the task in the status bar. If an error method of the command button occurs, would it be the best idea to have my base form class have a waserror property to hold whether one of these errors has occured to change what the message in status bar is or am I barking up the wrong tree because its easier to test some function like error() or such?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform