Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting string date to numeric
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00768883
Message ID:
00768942
Vues:
21
>Dear Fabian,
>
>Thanks for your reply and the code. Been racking my brains and my time on this one, but it feels good to know that my quest for shorter code was really unfounded ! Will adapt your code to my situation.
>
>Regards,
>
>Steve.

How would this work?
FUNCTION STRING2DATE (LCDATE)
   CRLF = CHR(13)+CHR(10)
   _MONTHS = + "JANUARY"    + CRLF ;
             + "FEBRUARY"   + CRLF ;
             + "MARCH"      + CRLF ;
             + "APRIL"      + CRLF ;
             + "MAY"        + CRLF ;
             + "JUNE"       + CRLF ;
             + "JULY"       + CRLF ;
             + "AUGUST"     + CRLF ;
             + "SEPTEMBER"  + CRLF ;
             + "OCTOBER"    + CRLF ;
             + "NOVEMBER"   + CRLF ;
             + "DECEMBER"   + CRLF 
   LCDAY=GETWORDNUM(LCDATE,1)
   LCMONTH=ALLTRIM(STR(ATLINE(UPPER(GETWORDNUM(LCDATE,2)),_MONTHS)))
   LCYEAR=GETWORDNUM(LCDATE,3)
   RETURN LCDAY + "/" + LCMONTH + "/" + LCYEAR
ENDFUNC
Tracy
Tracy
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform