Wildcard expressions and unicode ???

Richmond Mathewson richmondmathewson at gmail.com
Tue Apr 6 09:57:32 EDT 2010


  On 06/04/2010 14:57, Peter Brigham MD wrote:
> Try this? Untested but should work. (The untested part is the first 
> handler -- the offsets() function I have been using for years.)
>
> on mouseup
>    set the useUnicode to true
>    put numtochar(57888) into targetChar
>    put the unicodetext of fld "FIRST" into uText
>    put offsets(targetChar,uText) into offsetList
>    if offsetList = 0 then exit mouseup
>    repeat for each item i in offsetList
>       put char i+1 of uText & targetChar into \
>                  char i to i+1 of uText
>    end repeat
>    set the unicodetext of fld "FIRST" to uText
> end mouseup
>
> function offsets str,cntr
>    -- returns a comma-delimited list
>    -- of all the offsets of str in cntr
>    if str is not in cntr then return 0
>    put "" into offsetList
>    put 0 into startPoint
>    repeat
>       put offset(str,cntr,startPoint) into thisOffset
>       if thisOffset = 0 then exit repeat
>       add thisOffset to startPoint
>       put startPoint & comma after offsetList
>    end repeat
>    delete last char of offsetList
>    return offsetList
> end offsets
>
> -- Peter
>
Thank you very much; I'll give it a try.



More information about the use-livecode mailing list