Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking field data
Message
De
10/03/2004 09:40:20
 
 
À
10/03/2004 09:33:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00884808
Message ID:
00884814
Vues:
9
>My data arrives is two different formats:
>
>9999-99-999-9999
>and/or
>9999999999999
>
>1. How can I check to see which format it is arriving in?
>
>2. Based off the format that it arrives in, be able to appen 0's to those particular records that dont fill all the way (i.e. 123456, or 1234-56)

I think I would take it and always convert it down to one format
lc_data = "9999-99-999-9999"
lc_data = STRTRAN(lc_data, '-')
lc_data = PADR(lc_data, 13, '0')
lc_data = TRANSFORM(lc_data, '@R 9999-99-999-9999')
Of course you could combine multiple steps into one. But this is the way I would go about it. The STRTRAN won't do anyting for one's that don't contain a dash but atleast the data will be formated the same way each time.
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform