How to find and replace
Christian Langers
christian.langers at education.lu
Mon Jun 6 18:57:21 EDT 2005
Hi there,
thanks for the hints...
I'm with Rev 2.6. and I have used this (which works !)
put the clickText into tVar
put replaceText(fld 1,"\b"&tvar&"\b",underscores(length(tvar))) into
fld 1
function underscores pCount
repeat (pCount)+5
put "_" after tString
end repeat
return tString
end underscores
Thanks to you all,
Christian
from (sleepy) <yawn> Luxembourg ;-)
Le 7 juin 05 à 00:39, Dar Scott a écrit :
>
> On Jun 6, 2005, at 2:36 PM, Christian Langers wrote:
>
>
>> I need to do the following :
>>
>> repeat with x=1 to the number of chars of the clicktext+5
>> put "_" after char x of tChar
>> end repeat
>>
>> replace the clicktext with tChar in fld 1
>>
>> where i want the exact word to be replaced...
>>
>> e.g. I click "da" and I just want this to be replaced in the
>> field (not "das", "Dach","Dame",...)
>>
>> How can I solve this ?
>>
>
> A regular expression may include \b to match at a word boundary,
> even at the start or end of a string. Perhaps you can build up a
> regular expression and use replaceText(). (A "word" is a sequence
> of ASCII underscore, letter or digit that is bound by non-word
> characters or string boundary.)
>
> The replaceText() function is improved for speed in Revolution 2.6,
> I understand.
>
> Dar
>
> --
> **********************************************
> DSC (Dar Scott Consulting & Dar's Lab)
> http://www.swcp.com/dsc/
> Programming and software
> **********************************************
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list