Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Y2000 at FP2.6 Dos.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00130400
Message ID:
00130450
Vues:
13
>I have check my FP2.6 Dos, there is a function as belown:
>
>"SET CENTURY ON | OFF".
>
>but in VFP5.0 i can find "SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]"
>
>That is easy for me to handle the problem of Year 2000.
>
>
>Can u tell me how can i update my FP2.6, with this function.
>Do i need some Add-in product into my FP2.6

I'd say that you don't necessarily need an add on product or change the width and format codes for existing screens. All you need to do is write a short function that will evalulate the date and make the necessary adjustments. You can actually take advantage of the fact that FP 2.6 ignores the current year when evaluating dates that are entered in two digit format, it will always return 19nn.

What I've done is compare the year of the date passed to the function with the current year on the system using the YEAR() function. If these are not equal, and if the entered year is less than the system year less a rollover value, then add 100 to the year, and re-build the date. I've created this as a function so that it can be called from either a FP 2.6 valid clause or from a routine that imports dates from SDF files, where the format of the year portion of the date is in two digits.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform