2015-04-21 2 views
1

Как сравнить два поля прокрутки (у меня есть два поля, один из которых содержит текст, а другой содержит строку поиска & Заменить строку, разделяемую двоеточием. Я хочу искать каждое слово в первом поле прокрутки с помощью строка поиска во втором поле с прокруткой, если строка поиска находится в первом поле прокрутки затем вернуть определенные слова и счетчик строки поиска в первом поле с прокруткой)Как сравнить два поля прокрутки

on mouseUp 

    put the fld "MytextField" into myHtmll 
    put the field SRText into myArrayT 
    split myArrayT by CR 
    put the number of lines of (the keys of myArrayT) into myArrayl 
    repeat with j=1 to myArrayl 
     put myArrayT[j] into k 
     split k by colon 
     put k[1] into searchStr1 
     put k[2] into replaceStr1 
    end repeat 

    repeat for each word dd in field "MytextField" 
     if dd contains searchStr1 then 
     --put Wordss after mm 
     --answer searchStr1 
     answer ok 
     end if 
     answer searchStr 
    end repeat 

end mouseU 

Здесь «MyTextField» является первым полем скроллинга Здесь " SRText "является вторым полем прокрутки

ответ

1
on mouseUp 
    set the caseSensitive to true 
    put the field SRText into myArrayT 
    split myArrayT by CR 
    put the number of lines of (the keys of myArrayT) into myArrayl 
     put 0 into tmp 
    repeat for each key j in myArrayT 
     put myArrayT[j] into k 
     split k by colon 


     put k[1] into searchStr1 
     put the field "MytextField" into sss 
     repeat for each word ass in sss 

     if ass contains searchStr1 then 
      add 1 to tmp 
      put ass after sam 




     end if 
     end repeat 

    end repeat 
    answer sam 
     answer tmp 
end mouseUP 
Смежные вопросы