how to do this type of search

Robert Brenstein rjb at robelko.com
Tue Apr 10 19:42:23 EDT 2012


On 10.04.2012 at 10:06 Uhr +0900 Nicolas Cueto apparently wrote:
>  > The 'lineOffset' function will be your friend here...
>
>If only it truly were that simple...
>
>In my example, lineOffset would return "3" for "is". But "5" is what 
>I'm after.
>
>--
>Nicolas Cueto
>

untested but something along this should work:

function lineContainsExactMatch pWord,pText
   set the wholematches to true
   replace slash with tab in pText -- so we can search for was or were 
in was/were
   return the number of lines of (item 1 to itemOffset(pWord, pText) of pText)
end lineContainsExactMatch

Robert




More information about the use-livecode mailing list