Set::union Method [AX 2012]
Calculates and retrieves the union of two given sets. This is the set that contains the values found in at least one of the sets.
The following example creates two sets of integers and adds some values to them. It then creates a new set that contains all the values that are contained in either of the sets.
{
Set is = new Set (Types::Integer);
Set is2, is1 = new Set (Types::Integer);
;
is.add(1);
is.add(2);
is.add(3);
is1.add(2);
is1.add(4);
is2 = Set::union(is, is1);
// Prints "{1, 2, 3, 4}".
print is2.toString();
pause;
}
Show: