Cetin,
Thanks for your help
Regards,
Gerard
>>is there a Strtran function (or similar) which will replace text but in a case insensitive manner, e,g,
>>
>>Abc=Strtran(MyFruit,'Apples','Coca Cola')
>>Abc=Strtran(MyFruit,'apples','Coca Cola')......
>>
>>otherwise I will need to put every possible combination of 'Apples' in using Upper and lower case
>>
>>I am using Strtran on a memo field, so it is not possible just to upper it first
>>
>>Regards,
>>
>>Gerard
>
>Yet another strtranc :)
>
>
>FUNCTION strtranc
>LPARAMETERS tcString, tcSearch, tcReplace
>tcSearch = upper(tcSearch)
>LOCAL lnOccurences,lnLen,ix
>lnOccurences = OCCURS(tcSearch, UPPER(tcString))
>IF lnOccurences=0
> RETURN tcString
>ENDIF
>lnLen = LEN(tcSearch)
>FOR ix=1 TO lnOccurences
> tcString = STUFF(m.tcString,ATC(m.tcSearch,m.tcString,m.ix),;
> m.lnLen,m.tcSearch)
>ENDFOR
>RETURN STRTRAN(tcString, tcSearch, tcReplace)
>
Cetin