Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leap Year 2000 FPW2.6
Message
From
08/10/1998 15:53:59
 
 
To
08/10/1998 11:21:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00144937
Message ID:
00145186
Views:
24
>The problem with using the UDF in the VALID()is that is never hits this code. The On ReadError fires first. Therefore, I do not understand how the date+100 years could work.

ON READERROR only fires if the date is actually invalid. The only invalid date we have to worry about in most applications is if somebody enters "2/29/00" using a two-digit year. FoxPro thinks this means 2/29/1900 which is invalid and so the "invalid date" error message (or your ON READERROR code) is triggered before your VALID( ) can do anything about it. One solution to this is to ask users to enter "02/29/2000" -- using a four-digit year -- for that one date. Any other real date (i.e., any date which exists in both the 20th century as well as the 21st century) will be OK (not invalid) as far as Fox is concerned, so your VALID( ) code will fire and you can handle the century rollover there.

HTH,
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform