Hi Rixon,
I was going to suggest that you use a series of STRTRAN() commands but as STRTRAN() is case sensitive this won't work with mixed case unless you check for every combination.
If you have the codes you wish to check for in a table (or an array) you could check for the existence of each of these codes and then convert to upper case. Example follows ....
Select Codes
Scan All
lcNewString = ConvertCode(lcOldString, Codes.PostalCode)
EndScan
Function ConvertCode
Lparameters tcString, tcCode
Local lnStart
lnStart = Atc(tcCode, tcString)
Do While lnStart > 0
tcString = Substr(tcString, 1, lnStart-1)) + Upper(Substr(tcString, lnStart, Len(tcCode))) + Substr(tcString, lnStart+Len(tcCode))
lnStart = Atc(tcCode, tcString)
EndDo
Return tcString
EndFunc
Code is untested but you get the idea ....
HTH
Liam
>We have a field that includes city, country, and postal codes in mixed case. We would like to search for any Canadian Postal Codes (eg. v3a 2c1) and convert only those codes to upper case. How can this be accomplished? Thanks. Happy Holidays.
Liam O'Hagan
MCP VFP Desktop Apps