Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String parsing question
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01148374
Message ID:
01148383
Views:
22
>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--
Previous
Reply
Map
View

Click here to load this message in the networking platform