Мне нужно подсчитать количество пробелов слова в массиве из поля «MytextField». Массив состоит из более чем 9000 строк, а текст в поле «MytextField» состоит из более чем 10000 строк. Я использую следующий код, и он отлично работает, но нужно столько времени.Как считать наличие в livecode?
put the number of lines of (the keys of myArray) into myArrayL
repeat with i = 0 to myArrayL
put myArray[i] into k
split k by colon
put k[1] into searchStr
put k[2] into replaceStr
repeat for each line iword in Tex
if iword contains searchStr then
add 1 to tmp
put tmp & " " & searchStr & cr into sam
end if
--delete word iword of Tex
if iword contains replaceStr then
add 1 to tmp1
put tmp1 & " " & replaceStr & cr into sam1
end if
--delete word iword of Tex
end repeat
put sam after slu
put 0 into tmp
put "" into sam
put sam1 after slu1
put 0 into tmp1
put "" into sam1
end repeat
answer slu1
answer slu
Можно ли уменьшить расход времени? Как изменить этот код на более высокую скорость