>
>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