...
>>
>>Kevin,
>>Forgive me but personally I find such a class unnecessary. It makes you feel you're doing OOP maybe but that's all I can see.
>
>Cetin,
>
>Why do find it unnecessary?
No solid reason. I don't want to heat waters accept it as personal preference :)
I find it unnecessary because 'set' commands seldomly need a change along the code. I've a series of set commands that're effective for each form (and I use private datasessions almost always). Seldomly I need to change one or two in a form. I've already memorized my default settings (and you might say what about those maintaining your code - no answer), if for example as in Kevin's sample I need to set talk on :
set talk on
...
set talk off
Another reason is I find it very hard to write a class for the job. Not all set commands are as straightforward as set talk on/off. ie: consider set century, set reprocess etc
And yet another reason is maintanence. If I were reading someone else's code with :
o = createobject("SetCommand",'TALK','ON')
I sure would spend time to understand what it's doing. Also in code it need be (at least similar and heavy enough):
local o
o = createobject("SetCommand",'TALK','ON')
...
release o
...
Cetin