If I understand what you are looking for, try something like this (untested):
on FindMatches listA, listB
-- The output will be a list of all items which are in both lists
matchList = []
nItemsInListA = count(listA)
-- iterate through all the items in the first list
repeat with i = 1 to nItemsInListA
-- grab each item
itemFromListA = listA[i]
-- see if it exists in the other list
where = getOne(listB, itemFromListA)
-- if so, add it to the resulting matching list
if where > 0 then
append(matchList, itemFromListA)
end if
end repeat
-- return the matching list
return matchList
endHope this helps,
Irv
At 9:11 PM -0500 7/10/04, Matt Wells wrote:
Hello,
I'm at a bit of loss here on comparing two lists I need to find which values match in each list.
Basically does list A also have a 24 as does list B.
Here are the lists:
B1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
I1 = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
C1 = 1 C2 = highest number of the two lists
repeat with x = c1 to c2
--Some Crafty CODE
end repeat
Any Ideas? Or is there a simple way of doing this?
My brain is fried - need beer - going home
Thanks for the input
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
--
Multimedia Wrangler.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
