Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing Addresses
Message
De
13/04/2001 19:34:07
 
 
À
13/04/2001 19:14:28
Steven Herbin
SNH Computing Corporation
Swan Lake, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495481
Message ID:
00495485
Vues:
17
>I have a client whose City State ZIP line is an absolute mess and rather than have them hand code all the changes, I was wondering if the Fox World would have a better way.

You could start with this:
lcString = 'Sauk Rapids, MN  56379'

* First get out all of the multiple spaces and junk out.
lcString = chrtran(lcString, ',' + chr(9), space(2))
do while space(2) $ lcString
	lcString = StrTran(lcString, space(2), space(1))
enddo

lnStartZip = rat(space(1), lcString) + 1
?'Zip: ' + substr(lcString, lnStartZip)
lnStartState = rat(space(1), lcString, 2) + 1
?'State: ' + substr(lcString, lnStartState, lnStartZip - lnStartState)
?'City: ' + substr(lcString, 1, lnStartState - 2)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform