Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to keep procedure
Message
De
27/07/2000 10:43:42
 
 
À
27/07/2000 09:28:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00397542
Message ID:
00397585
Vues:
8
>I have a procedure that is used in most forms that I have in my TblClass.vcx. I drag and drop TblClass onto the form then use the procedures in there. I just had the thought that it would be easier to just add a Method to my form base class for IsEmpty(). That way it is always there when I need it. Is there any reason not to have several procedures added to your form class to handle routine things?
>
>Basicly IsEmpty() just checks the control.value to see if it is empty(). if it is empty it puts up a messagebox and returns the focus to that control. I use it in my cmdSave control...
>

If it's a common method for all your Forms, it makes sense to add it as a custom method to your base form class; you don't have to use it if you don't want to, but it's there and accessible. This now lets you delegate responsibility to the form for the method; anything that needs it like your cmdSave can reference the Form property, as could any other control or method of the form that might need it. If some sort of specialized behavior unique to a Form modifies the behavior, you can add instance code to the method and access it in the same way as other references to the method are made - the controls that rely on it don't need to be aware of the change.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform