2015-05-26 20 views
0

如何突出顯示綠色的單詞,如果它出現兩次,並且出現三次,那麼它應該以紅色突出顯示,如果ti出現超過三次,則應該用顏色橙色。可能嗎。我使用下面的代碼我如何更改我的代碼如何在livecode中突出顯示單詞

on mouseUp 

    put the field "f1" into sss 
     repeat for each word ass in sss 
     if ass contains shalu then 
      --put tmp into 0 
      add 1 to tmp 
      --answer "answer found" 

     end if 

     end repeat 

     answer tmp 
     if tmp >2 then 
     answer "more than two" 
     else 
     answer"only two times" 
     hilight "shalu" 
     end if 
end mouseUp 

回答

0

要HILITE一個字不選擇它,使用背景色屬性:

set the backColor of char 23 to 27 of fld 1 to green