Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing Addresses
Message
From
13/04/2001 19:34:07
 
 
To
13/04/2001 19:14:28
Steven Herbin
SNH Computing Corporation
Swan Lake, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00495481
Message ID:
00495485
Views:
18
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform