>>Every time I see code written by someone else I always see things like:
>>
>>Procedure ??
>> lcTalk = Set('Talk')
>> Set Talk Off
>> .........
>> Set Talk &lcTalk
>>EndProc
>>
>>Is there a reason people don't use a class to save & restore settings
>>
>>Procedure ??
>> loTalk = CreateObject('Save_Talk')
>> .....
>>EndProc
>>Define Class Save_Talk as Custom
>> cTalk = Set('Talk')
>> Procedure Init()
>> Set Talk off
>> EndProc
>> Procedure Destroy()
>> Set Talk This.&cTalk
>> EndProc
>>EndDefine
>>
>
>How about: Because I never thought about it? I really like it though. In effect, you are localizing global settings, and that is a good thing IMO. I also think that this might qualify as a good example of the "State" design pattern. I usually prefer the OOP way of doing things, so I'll probably use this technique in the future, especially for restoring global settings and work areas. Thanks for sharing.
Hi Joel,
Before you start on the Cleanup Class, check my reply to Nick. Put all your simple settings into 1 class and pass the setting-name as a parameter. Keeps things as simple as possible.
Bill Morris