Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String parsing question
Message
From
24/08/2006 17:01:55
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01148374
Message ID:
01148381
Views:
16
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform