Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
STRTRAN no matter the case
Message
From
25/09/1997 16:45:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
STRTRAN no matter the case
Miscellaneous
Thread ID:
00051670
Message ID:
00051670
Views:
71
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)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform