Q: How do I set and reset environment settings?
A: Use the VFEc Set class to set, reset will happen when the object gets destroyed.
I am always fearful of changing Set commands in a framework environment. I am not sure what other toes I may be stepping on. Is there a preferred way to perform Set commands and to remove them? Something like using a Stack push and pop logic, or should I just point the environment my way.
The class cset of vfe6\vfeframe\libs\CUTILS.VCX will save, set and restore SET settings.
loBellSet = CreateObject( "cSet", "Bell", "ON" )
bunch o' code
When loBellSet is created, it saves the current setting of Bell and sets bell to ON. When loBellSet is released, its destroy event will set bell back to the saved setting.
There is also the big cahonas: cGlobalEnvironment and cSessionEnvironment of vfe6\vfeframe\libs\cenviron.vcx -- they will save and restore everything.
Contributors: Carl Karsten
Back: Visual FoxExpress Faq
Category Visual FoxExpress Category Visual FoxExpress Tips And Tricks
( Topic last updated: 1999.09.27 02:49:30 PM )