$common list items

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
$common list items is a [[Variable Functions|Variable 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. Instead  
 
This function works in the opposite way that the subtract list function works. Instead  

Revision as of 15:06, 11 April 2013

$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.


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")

File:Common.png


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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox