Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why don't I see cleanup class?
Message
 
 
To
21/06/2002 11:58:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671062
Message ID:
00671071
Views:
13
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform