Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional STRTRAN
Message
From
09/02/2015 11:48:05
 
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:
01615020
Views:
63
>>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform