Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 Using strtran with wildcards
Message
From
16/10/2000 15:47:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00429940
Message ID:
00429984
Views:
15
>>replace horse_name with left(horse_name, at("(", horse_name)-1))
>
>This gives me a error message "command contains unrecognized phrase/keyword"
>
>Do you think that the strtran function can be used with wildcards?

Sorry, won't work. StrTran() does exactly what it's supposed to do, so if you need parentheses removed, you'll have to code around. One way to do it would be
nOcLeft=occurs("(", cYourString)
nOcRight=occurs(")", cYourString)
do while nOcLeft=nOcRight and nOcLeft>0
   nAtLeft=at("(", cYourString)
   nAtRight=at(")", cYourString)
   cYourString=stuff(cYourString, nAtLeft, nAtRight-nAtLeft+1, "")
   nOcLeft=occurs("(", cYourString)
   nOcRight=occurs(")", cYourString)
enddo

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