Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional STRTRAN
Message
From
09/02/2015 11:52:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01615018
Message ID:
01615022
Views:
59
>>>>Hi All:
>>>>
>>>>I want to check fields in a table for illegal characters and replace them with '*'. This is because I'm running a program that converts table data to XML and the program chokes on illegal characters.
>>>>
>>>>Is there a way to say something like this:
>>>>
>>>>
>>>>replace all cField with STRTRAN(cField, IllegalCharacter, '*')
>>>>
>>>>
>>>>Thanks,
>>>>
>>>>Yossi
>>>
>>>Yes, use CHRTRAN instead.
>>
>>If I understand this correctly, I would have to build a string of illegal characters first. Something like:
>>
>>
>>lcNotLegal = chr(1) + chr(2) + chr(3) + .........
>>lcReplacement = replicate('*', len(lcNotLegal))
>>replace all cField with CHRTRAN(cField, lcNotLegal, lcReplacement)
>>
>
>Yes, that would work.

Thanks. Although it would be a lot better to come up with a list of LEGAL characters. The illegal one will turn out to be rather long. Thanks again.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform