Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why don't I see cleanup class?
Message
From
21/06/2002 13:18:54
 
 
To
21/06/2002 11:58:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671062
Message ID:
00671129
Views:
17
>Is there a reason people don't use a class to save & restore settings
>
>Procedure ??
>  loTalk = CreateObject('Save_Talk')
>  .....
>EndProc    && Local variables go out of scope forcing destroy()
>Define Class Save_Talk as Custom
>  cTalk = Set('Talk')
>  Procedure Init()
>    Set Talk off
>  EndProc
>  Procedure Destroy()
>    Set Talk This.&cTalk
>  EndProc
>EndDefine
>



I use that all the time. It is also used a lot in the VMP Framework which I use now and then.

One improvement I see in your example is not to set TALK OFF but - as I mentioned to Nick earlier - to just save state, then it restores it to whatever it was.

Just my .02


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform