Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Year 2000 problem
Message
From
19/09/1997 07:29:26
 
 
To
18/09/1997 16:34:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00050555
Message ID:
00050690
Views:
31
>>Any thoughts on how to handle existing code to solve
>>the year 2000 problem.
>>
>>ajay
>For VFP3 you can add the following to the valid() event of a text box for dates:
>if alltrim(upper(set('CENTURY')))='ON' && Do only if 2 digit years in effect
> return 1
>endif
>
>if !empty(this.value) && need an input value
> if type('this.value')=='C'
> this.value=date()
> return 1
> endif
> if !empty(this.epoch) && need an epoch trigger
> if substr(str(year(this.value),4),1,2)='19' && may have used calendar control so only if 19xx
> if this.value> this.value=this.value+36525 && 100 years of 365 days plus 25 leaps
> return 1
> endif
> endif
> endif
>endif
>
>epoch is a custom property set to the rollover year (i.e. 1921, 1970 or whatever fits the app)
>
>HTH

One tiny problem with this. Try to enter the date 02/29/00, a valid date for year 2000. The problem here is that Feb 29, 1900 is not a valid date (not a leap year).

I must admit though, that I have used this work-around in all of my 2.6 apps and plan to hide when my clients want to enter 02/29/00! :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform