$common list items
From UBot Studio
(Difference between revisions)
(→Example) |
|||
(4 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | $common list items is a [[Data Functions|Data Function]]. This function allows you to compare two lists and return a list containing all items | + | $common list items is a [[Data Functions|Data Function]]. This function allows you to compare two lists and return a list containing all items that are common to both lists. |
− | that are common to both lists. | + | |
− | This function works in the opposite way that the subtract list function works. | + | This function works in the opposite way that the subtract list function works. |
− | of comparing two lists and finding items only unique to the first list, it finds list items | + | |
− | common to both lists. | + | Instead of comparing two lists and finding items only unique to the first list, it finds list items common to both lists. |
+ | |||
+ | '''List 1:''' First populated list. | ||
+ | |||
+ | '''List 2:''' Second populated list. | ||
== Example == | == Example == | ||
+ | |||
<pre> | <pre> | ||
clear list(%list2) | clear list(%list2) | ||
Line 15: | Line 20: | ||
</pre> | </pre> | ||
− | [[File: | + | |
+ | [[File:clt2.jpg]] | ||
Running the script above should return only items a and b in the field that will be filled. | Running the script above should return only items a and b in the field that will be filled. | ||
List items a and b are common to both lists. | List items a and b are common to both lists. |
Latest revision as of 00:17, 28 December 2016
$common list items is a Data Function. This function allows you to compare two lists and return a list containing all items that are common to both lists.
This function works in the opposite way that the subtract list function works.
Instead of comparing two lists and finding items only unique to the first list, it finds list items common to both lists.
List 1: First populated list.
List 2: Second populated list.
[edit] Example
clear list(%list2) clear list(%list1) add list to list(%list1, $list from text("a,b,c,d", ","), "Delete", "Global") add list to list(%list2, $list from text("a,b,x,v", ","), "Delete", "Global") type text(<about me textarea>, $common list items(%list1, %list2), "Standard")
Running the script above should return only items a and b in the field that will be filled.
List items a and b are common to both lists.