how do i get all the existing results using matchtext, not only the first one?
text to search within
Code: Select all
test
karl
neuer test
hugo
test
Code: Select all
matchtext(texttosearchwithin, "test", listofresults)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
test
karl
neuer test
hugo
test
Code: Select all
matchtext(texttosearchwithin, "test", listofresults)
Code: Select all
put texttosearchwithin into temp
put 0 into counter
repeat while offset("test",temp) > 0
add 1 to counter
put offset("test",temp) into listofresults[counter]
delete chars 1 to n of temp
end repeat
Code: Select all
function revFullFind tText,tFind,exactly --RETURNS LINE NUMBER & "," & WORD NUMBER
put 0 into counter
switch exactly
case "true"
case empty
repeat for each line tline in tText
add 1 to counter
if tFind = tline then
put counter & return after tResult
end if
end repeat
break
case "false"
repeat for each line tline in tText
add 1 to counter
if tFind is in tline then
repeat with y = 1 to the number of words in tLine
if word y of tLine = tFind then put y & "," after temp
end repeat
delete last char of temp
put counter & "," & temp & return after tResult
put "" into temp
end if
end repeat
break
end switch
return tResult
end revFullFind