how to set the textStyle of word 1 of the selection?
    Andre.Bisseret 
    Andre.Bisseret at inria.fr
       
    Mon Mar 15 10:16:38 EDT 2010
    
    
  
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é
    
    
More information about the use-livecode
mailing list