Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Chrtran() applied selectively
Message
De
07/06/2016 09:50:43
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
07/06/2016 06:05:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01636985
Message ID:
01637057
Vues:
57
>>Just in the third part... like this:
>>
>>
+ CHRTRAN(GETWORDNUM(mstr, 3, ':'), '-=_', '...')
>
>I understood that bit
>
>I'm just not too keen on chrtran() anything after the second colon

Me too. I had a similar case, when I needed to import something and add a "(1)" to its caption if it already existed, or "(n+1)" if "(n)" existed. Which was easy, I thought, just find anything in parentheses, remove it and run a SQL with " caption like 'title without parentheses%+ and ...". Which worked swimmingly until there was one caption with a word in parentheses in the middle.

So I had to amend my code to look for rat("(", caption, 1), chop the string to the right, then see if that contained digits, then remove that string (and the parentheses) and leave anything to the left intact.

Every time I had to do such manipulation on man made strings, I took it as a little disaster biding its time. People just don't understand the rules set there, and why would this or that break one of those. Keeps us in business forever.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform