Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Christof... your Y2k code...
Message
 
To
02/10/1998 17:01:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00143466
Message ID:
00143562
Views:
16
Hi Bob,

>One issue... If the user enters a 4 digit date, it still gets rolled over.
>
>For example, user enters 1/1/1905 it changes to 1/1/2005. Can you think of a way to modify it so that the rollover does not occur if the user enters the full 4 digit date?
>
>Our ap has SET CENTURY ON all the time.

Well, the code was designed for applications that have SET CENTURY OFF. The latest version (available for download on CompuServe) does support 4-digit years, but ONLY in a range of 100 years.

The reason is that it is quite difficult to capture the actual input. When the valid fires FoxPro has already added 19xx to the date if it was a 2-digit date, so I've no possibility to find out whether the user entered 1905 or just 05. Therefore rollover is always done if the date is below the rollover value.

If you really want to do it in purely FoxPro you have to capture all keys that could force FoxPro to leave a field, like ENTER, TAB, etc. then you could apply the same technique as it is used for 02/29/00. IMO, that's not worth the trouble and you're better served by checking out Neil Weicher's Y2KFOX solution. It's really impressive. AFAIK, it can distinguish between 2-digit and 4-digit years and only performs a rollover on 4-digit years.

Christof
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform