I've used Visual FoxExpress so much that I've been spoiled. It has its own environment class that does exactly that. When I've been forced to code in vanilla VFP (like I am now :o(), I tend to create a setup environment routine and a cleanup environment routine, because that is generally the code I have inherited from other developers.
Tracy
>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
>
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"