Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not my date type
Message
De
29/03/2014 11:31:07
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Not my date type
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01597645
Message ID:
01597645
Vues:
83
Hi All,

Is there a better, or shall I say more elegant, way of extracting the numeric values from a date-formatted ("03/27/2014") text string than the following:

lnmon=val(left(alltrim(this.text),2))
lnyear=val(right(alltrim(this.text),4))
lnday=val(substr(alltrim(this.text),4,2))
lddate=date(lnyear,lnmon,lnday)


?

It relates to dbi-tech's ctdropdate.ocx calendar datepicker. It converts date() to its own numeric value, say 41567 (no. of days since 01/01/1900), but returns the date in a text string. There's doesn't appear to be an easy way to make it revert to a date vartype(), other than these sorts of coding gymnastics. It works fine, just looks brutal. Any ideas?
Thanks.

Luke
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform