how to set the textStyle of word 1 of the selection?

Peter Brigham MD pmbrig at gmail.com
Mon Mar 15 17:52:41 EDT 2010


Or this way:

on mouseup
    put the selectedchunk into selCh
    if the selectedtext = empty then exit mouseup
    put the long id of the selectedfield into fldRef
    put value(fldRef) into fldText
    put word 2 of selCh into startChar
    put the number of words of char 1 to startChar \
           of fldText into wordNbr
    set the textstyle of word wordNbr of \
           fldRef to "link"
end mouseup

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Mar 15, 2010, at 10:16 AM, Andre.Bisseret wrote:

>
> Le 15 mars 10 à 14:26, Klaus on-rev a écrit :
>
>> Bonjour Andre,
>>
>>> Thank you Richmond for your prompt answer.
>>> But with "the first word" instead of "word 1" I get the same  
>>> errors. Does not work
>>> Any other idea?
>>
>> "the selection" returns the selected text and NOT a chunk  
>> describing the selection!
>>
>> So you may need to check "the selectedchunk" or something to get to  
>> know what to
>> format the way you want to.
>>
> Guten tag Klaus,
>
> Ah! OK !
> I wrote that :
> ---------------------
> on mouseUp
>   local firstCharNum,firstWordLength,lastChar,lastCharNum,
>   ----------
>   put the number  of chars of word 1 of the selection into  
> firstWordLength
>   put word 2 of the selectedChunk into firstCharNum
>   put firstCharNum + firstWordLength - 1 into lastCharNum
>   set the textStyle of char firstCharNum to lastCharNum of fld 1 to  
> "link"
> end mouseUp
>
> not really straightforward ;-)) but that works!
>
> Danke sehr!
>
> André
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list