Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Desperate for help with Year 2000 & CTOD incompatibility
Message
From
26/06/1998 15:35:20
 
 
To
26/06/1998 14:53:15
Dermot Hill
Astral Software
Dublin, Ireland
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00111866
Message ID:
00112051
Views:
28
>Rick,
>The problem I'm trying to resolve is with Foxpro 2.6 I cannot afford to convert all old apps to VFP. Foxpro2.6 only supports SET CENTURY ON and has no ROLLOVER capability. I've been told that a replacement function was available with the March issue of Foxpro Advisor.

Dermot,

OK. But there is no problem with CTOD( ) in Fox 2.6 as long as you give it a 4-digit year. On the other side of things, since all dates are stored with 4-digit years in the DBF regardless of whether SET CENTURY is (or was) ON or OFF, any DTOC( ) comands are OK too.

The only issue is what happens when a user enters a 2-digit year, then you have to make an assumption about the century. You're correct, the March 1998 issue of FoxPro Advisor has a nice article by Christopf Lange which presents a solution for this. The May 1996 issue of FoxTalk also carried a solution, by David Diehl, called EPOCH( ). If you decide to use this one, be sure to see my follow-up article in the May 1997 FoxTalk.

If you are not able to use a solution like one of those, the fallback plan for Fox 2.6 IMHO is simply to have your users enter 4-digit years for all dates in the 21st century. SET CENTURY ON for your entire app, and widen all the date fields in your screens and reports to accomodate 10 characters. The only clinker, I suppose, is if you have any date literals stored in character format (and let's hope not, for lots of reasons!) then those will have to be converted to 4-digit years manually unless they're always supposed to be the 20th century.

HTH,
Rick
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