Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String parsing question
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01148374
Message ID:
01148383
Vues:
20
>I have an address field that is in the format "MAITLAND FL 32751-4831". I also have an a_states array for each of the 50 states. What is an efficient way to parse the address into tcity, tstate, tzip?
lcAddress = "NEW MAITLAND FL 32751-4831"
DIMENSION laAddrParts[1]
lnCount = ALINES(laAddrParts, lcAddress,1,SPACE(1))
lcZip = laAddrParts[lnCount]
lcState = laAddrParts[lnCount-1]
lcCity = ""
FOR i=1 TO lnCount-2
	lcCity = lcCity + SPACE(1) +  laAddrParts[i]	
ENDFOR
lcCity = ALLTRIM(lcCity)
LIST MEMORY LIKE lc*
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform