Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
STRTRAN no matter the case
Message
From
25/09/1997 19:17:18
 
 
To
25/09/1997 16:45:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00051670
Message ID:
00051695
Views:
36
Instead of your SUBSTR() + STRTRAN() use STUFF() (you know where the string is and how long it is). It's faster.

Vlad

>Thanks to Edward and Marc for having helped me in the STRTRAN to replace everything no matter what the case is.
>
>Here's the function I built to solve this:
>
>CheckIt('michel','notes')
>
>FUNCTION CheckIt
>* expC1 Text to replace
>* expC2 Name of the memo field
>PARAMETER tcText,tcMemo
>LOCAL lcText
>LOCAL lnPosition
>lnPosition=ATC(tcText,&tcMemo)
>DO WHILE lnPosition>0
>   lcText=SUBSTR(&tcMemo,lnPosition,LEN(tcText))
>
>   * Replace the memo field temporary with a string you can be sure is not part of it
>   REPLACE (tcMemo) WITH STRTRAN(&tcMemo,lcText,'UNIVERSALTHREADONTOP')
>
>   lnPosition=ATC(tcText,&tcMemo)
>ENDDO
>
>* Now, lets do the final replace
>REPLACE (tcMemo) WITH STRTRAN(&tcMemo,'UNIVERSALTHREADONTOP',tcText)
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform