$subtract lists

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
$subtract lists is a [[Data Functions|Data Function]].
+
$subtract lists is a [[Data Functions|Data Function]] in the Professional and Developer editions of UBot Studio.
  
 
The function returns the first list with all items from the second list removed from it
 
The function returns the first list with all items from the second list removed from it
  
This command allows you to compare two lists and create a new list containing all
 
items that are common in both lists.
 
  
'''List1:'''
+
'''List1:'''The main list the second list will be subtracted from.
  
'''List2:'''
+
'''List2:''' The list being subtracted from the first list.
  
  
Line 20: Line 18:
 
</pre>
 
</pre>
  
[[File:subtract.png]]
 
  
Using the [[Type text|type text]] function to fill our field with the list items that are found in both lists.
+
[[File:slt2.jpg]]
Running the script returns list items three and four.
+
 
 +
 
 +
Using the [[Type text|type text]] function to fill our field with the contents of the first list with the contents of the second list removed from it.

Latest revision as of 23:43, 27 December 2016

$subtract lists is a Data Function in the Professional and Developer editions of UBot Studio.

The function returns the first list with all items from the second list removed from it


List1:The main list the second list will be subtracted from.

List2: The list being subtracted from the first list.


[edit] Example

In this example, the contents of $my list1 is subtracted from the contents of $my list2.

add list to list(%my list1, $list from text("one,two,three,four", ","), "Delete", "Global")
add list to list(%my list2, $list from text("zero,one,two,five,six", ","), "Delete", "Global")
type text(<about me textarea>, $subtract lists(%my list1, %my list2), "Standard")


Slt2.jpg


Using the type text function to fill our field with the contents of the first list with the contents of the second list removed from it.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox