Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional STRTRAN
Message
De
09/02/2015 11:52:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01615018
Message ID:
01615022
Vues:
45
>>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform