Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatic Destroy method
Message
De
08/08/2007 18:30:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01246863
Message ID:
01246908
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>If I'm creating an object as my form's property such as oBill, for example, I always start it with an 'o'. I'm thinking, is it possible to make a generic Destroy method to SET such objects to NULL instead of making changes to each form class where I'm creating such properties.
>
>I guess I can loop through aMembers for the form, check the first letter, etc.

You could also check all properties, if they are of type "O".

>Do you think it's worth the trouble to make a generic Destroy method or it's better to continue the current practice of modifying each individual form's Destroy method?

As to this desirability, I am not quite sure. But do consider that anything you do at the root of the hierarchy of form classes, you will have to do only once. And, it might help you have less hard-to-find bugs, in this case, a form not releasing, 'cause you forgot to destroy some individual object.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform