Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chrtran() applied selectively
Message
From
07/06/2016 09:50:43
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
07/06/2016 06:05:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01636985
Message ID:
01637057
Views:
61
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform