Looking at the code for that statement, it is incorrect. I think it should be:
local CITYSTATEZIP,xCity,xState,xZip,xCountry,temp
CITYSTATEZIP = parameter(1)
xCity="" xState="" xZip="" xCountry=""
if striptonum(CITYSTATEZIP)<>""
if length(striptonum(CITYSTATEZIP))=5
xZip=striptonum(CITYSTATEZIP)
xCity=city(xZip)
xState=state(xZip)
else
xCity=upperword(CITYSTATEZIP[1,","][1,"-A-z"])
xState=upper(CITYSTATEZIP[",",-1]["A-z",-1][1," "][1,"-A-z"])
xZip=upper(CITYSTATEZIP["- ",-1][2,-1])
if length(xZip["A-Z","-A-Z"])>0
temp=strip(after(CITYSTATEZIP,","))
xState=upper(firstword(temp))
xZip=upper(after(temp," "))
xCountry="CANADA"
endif
endif
else
xCountry=upper(CITYSTATEZIP["- ",-1]["A-z",-1])
xCity=CITYSTATEZIP[1,"- "][1,"-!-z"]
xState=""
xZip=""
endif
setparameter 2,xCity
setparameter 3,xState
setparameter 4,xZip
setparameter 5,xCountry
I have not tested this for Canada. There may be better ways to do this. It does not work for Zip+4. I could probably fix that, but it is late.