Hi
has anyone created a script to compare 2 arrays like this :
compare the 2 arrays
- the items that are only in array 1 go into a new array
- the items that are only in array 2 go into another new array
- the items that are in both arrays go into another new array
like this :
Global $Compare1[10] = [1, 3, 5, 6, 7, 8, 9, 10, 11, 12]
Global $Compare2[10] = [1, 2, 3, 4, 5, 6, 8, 10, 12, 13]
$whatsLeftOfCompare1 = [7, 9, 11]
$whatsLeftOfCompare2 = [2, 4, 13]
$whatsInBoth = [1, 3,
no claim of improvement, just another one
this returns results in a 2D array
col1 contains values contained only in first array, col2 those contained only in the second one, and col3 in both
#include <Array.au3>
Local $a[11] = [1, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12]
Local $b[12] = [1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 13, 14]
_ArrayDisplay(_Separate($a, $b))
Func _Separate(ByRef $in0, ByRef $in1)
$in0 = _ArrayUnique($in0, 0, Default, Default, 0)
$in1 = _ArrayUnique($in1, 0, Default, Defaul