Set.union(Set, Set) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
public:
static Microsoft::Dynamics::Ax::Xpp::Set ^ union(Microsoft::Dynamics::Ax::Xpp::Set ^ _set1, Microsoft::Dynamics::Ax::Xpp::Set ^ _set2);
public static Microsoft.Dynamics.Ax.Xpp.Set union (Microsoft.Dynamics.Ax.Xpp.Set _set1, Microsoft.Dynamics.Ax.Xpp.Set _set2);
static member union : Microsoft.Dynamics.Ax.Xpp.Set * Microsoft.Dynamics.Ax.Xpp.Set -> Microsoft.Dynamics.Ax.Xpp.Set
Public Shared Function union (_set1 As Set, _set2 As Set) As Set
Parameters
- _set1
- Set
The second of the two sets that are compared.
- _set2
- Set
The second of the two sets that are compared.
Returns
The set containing elements found in set1 or set2.
Remarks
The two sets that are compared must be of the same type.
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;
}