Quickest was to compare 2 CR lists?

Terry Judd tsj at unimelb.edu.au
Tue Nov 4 04:37:16 EST 2008


That looks pretty good to me. Maybe put a CR at the front and back of list 2
and then...

local newList

repeat for each line theLine in list1
  if list2 contains cr&theLine&cr then
    put tLine&cr after newList
  end if
end repeat
delete last char of newList

...that way you'll avoid partial matches (unless you want them).

Terry...


On 4/11/08 8:08 PM, "Klaus Major" <klaus at major-k.de> wrote:

> Hi all,
> 
> anyone knows the quickest ways to compare 2 CR delimited lists?
> I need to know what lines of list 1 are contained in list 2.
> 
> Right now I am using repeat "for each" and "lineoffset", which is fast,
> but I'm ure this can be done even faster :-)
> 
> List 1 = k1
> List 2 = k2
> 
> ...
>    repeat for each line i in k1
>      if lineoffset(i,k2) <> 0 then
>        put i & CR after new_ list
>      end if
>    end repeat
> delete char -1 of new_ list
> return new_ list
> ...
> 
> 
> Best
> 
> Klaus Major
> klaus at major-k.de
> http://www.major-k.de
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

-- 
Dr Terry Judd
Lecturer in Educational Technology (Design)
Biomedical Multimedia Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne
Parkville VIC 3052
AUSTRALIA

61-3 8344 0187




More information about the use-livecode mailing list