Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change to European date
Message
 
 
To
16/11/2018 13:43:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01663305
Message ID:
01663469
Views:
35
>>>
>>>DEFINE CLASS DateSetting AS Custom
>>>   Value = ""
>>>    PROCEDURE INIT
>>>        THIS.Value = SET("DATE")
>>>    ENDPROC
>>>    PROCEDURE Set
>>>        LPARAMETERS tcValue
>>>        SET DATE &tcValue
>>>    ENDPROC
>>>    PROCEDURE Destroy
>>>        LOCAL lcValue
>>>        lcValue = THIS.Value
>>>        SET DATE &lcValue
>>>    ENDPROC
>>>ENDDEFINE
>>>
>
>Tom Rettig's envlib.prg does this in .init() - saves the current value to this.oldval, and sets the date (or any other setting, there's a subclass for each) to whatever is passed as parameter to init. Pretty much the same idea, but saves you one line when calling - and that's 50% of the lines you need to write :).

Now the question is, do it in Load() (as Naomi) or in Init() (as Tom Rettig). And, if you know, is envlib.prg available anywhere for download?
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform