Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why don't I see cleanup class?
Message
De
21/06/2002 13:18:54
 
 
À
21/06/2002 11:58:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00671062
Message ID:
00671129
Vues:
16
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform