Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Year 2000 problem
Message
From
18/09/1997 16:34:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00050555
Message ID:
00050610
Views:
23
>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
Gary
Helping Make Ideas Reality
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform