Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why don't I see cleanup class?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00671062
Message ID:
00671125
Vues:
18
>>And then I need to remember the name of this class, how to call it, etc. What if somebody wants the class which sets/restores TALK ON instead of OFF? Create another class, or add two methods to SETTALK class (or one method and pass the parameters), remember methods names, etc...
>
>Nope. Create the class to save the current state in a custom property (e.g. cOldSet) in Init() and restore it in Destroy() or thereabouts.
>
>Then you instance the class, it saves current state, you change it in your method/program, to ON|OFF or whatever the case may be.
>
>Upon leaving the method, the state gets restored automagically.

Still, we are talking here not about single SET TALK case, but rather the consistent approach. Then, for all similar commands you will need to create more classes like that (and remember or look up their names), or one universal SET class and pass the parameters to it.
I like to play devil's advocate on Fridays... :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform