Biks 9 Posted February 1, 2016 Report Share Posted February 1, 2016 I'm probably not doing this right. (seeing that I'm a Photoshop guy, and not a programmer.) I want to check an item against a previously saved list, if it's not on this list, then do something. The flow looks like this: http://imgur.com/6P57J7S.jpg I've got two lists. List ONE is recently scraped users. List TWO are scraped users in the past. (userstollsave) I don't want to deal with a newly scraped user if I've already dealt with them in the past. Should I compare my two lists first? Make a third list of users who aren't on the old list? Then select next list item from this third list? (how would I do that?) EDIT 10 MINUTES LATER OK, found it via Google search, not forum search. (as usual) http://network.ubotstudio.com/forum/index.php/topic/15286-comparing-lists-if-list1-item-exist-in-list2-then-ignore-function-else-perform/ Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 1, 2016 Report Share Posted February 1, 2016 That will work for basic checking, but if you want to see if the list item as an exact match is in the other list you will have to loop through and check. For example you may have a list item in list1 that is: "hello there" then in list2 you have the word: "there" it would be contained in the other list but it would not be an exact match. Quick example of that: clear list(%list) add list to list(%list,$list from text("hello there,hi,hey",","),"Delete","Global") if($contains(%list,"there")) { then { alert("yes") } else { alert("no") } } If you want to see if one list item is the exact same in another list then you have to loop through each list to check like so: clear list(%list) add list to list(%list,$list from text("hello there,hi,hey",","),"Delete","Global") clear list(%list2) add list to list(%list2,$list from text("hello there,1,2,3,4,5,hi",","),"Delete","Global") loop($list total(%list)) { set(#list_item,$next list item(%list),"Global") set list position(%list2,0) loop($list total(%list2)) { if($comparison(#list_item,"=",$next list item(%list2))) { then { alert("{#list_item} is found in both lists") } else { } } } } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.