Find

Jim Hurley jphurley at jps.net
Thu Apr 25 07:27:01 EDT 2002


>
>I'd like a script which search for all occurences of a word in a list
>and returns the number of all lines.
>
>
>an example :
>
>a list with :
>
>Peter
>John
>Richard
>John
>George
>John
>Philip
>Tom
>
>So if i call the code for "John", the result should be :
>
>2
>4
>6
>

How about something like:

Assuming the list of names is in field 1 and the  line numbers are to 
go into field 1 then:

on mouseUp
   put getLines("John",field 1)into field 2
end mouseUp

function getLines tName, tNames
   repeat with i = 1 to the number of lines in tNames
     if tName is in line i of tNames then put i & return after results
   end repeat
   return results
end getLines
-- 
Jim Hurley



More information about the use-livecode mailing list