Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why don't I see cleanup class?
Message
 
 
À
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:
00671071
Vues:
14
>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

Actually, some programmers use saving settings class. I believe, Marcia Akins has such class in her book. (I've heard about it, but don't have the book :()

Yep, see Re: A class or a prg to save and restore all environment set Thread #620085 Message #620447

>
>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 - this would not work
    if this.cTalk = 'ON'
       set talk on
    else
       set talk off
    endif
  
>  EndProc
>EndDefine
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform