Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strtran preserving case
Message
 
 
À
20/08/2009 10:02:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01419229
Message ID:
01419243
Vues:
62
>I need to make a mass replace of one word to another word but I want to preserve the case.
>
>Example I want to change TheOldWord to TheNewWord. But if the theoldword is this way then it needs to be thenewword or if is TheOLDWord it needs to be TheNEWWord or THEOLDWORD to THENEWWORD. I don't know all the cases that it might be in.
>
>I was hoping to not have to use ATC to find the word then loop checking the case with isupper and islower functions.

I would create a translation cursor with old a new value pairs and use is it along with ATC(). Every time you find new old word you add new translation record to the cursor. This way you'll have to create translation only once per different old word. You can even prefill the cursor with known translations.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform