Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String parsing question
Message
De
24/08/2006 17:01:55
 
 
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:
01148381
Vues:
17
>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?
>
>Thanks
>
>Brenda

How about something like
lnWordCount = GETWORDCOUNT(lcAddress)
tzip = GETWORDNUM(lcAddress,lnWordCount)
tstate = GETWORDNUM(lcAddress,lnWordCount-1)
tcity = ""
FOR I = 1 TO lnWordCount -2
   tcity = tcity + " " + GETWORDNUM(lcAddress,I)
ENDFOR
tcity = SUBSTR(tcity,2)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform