Support of basic operations on Sets in Dynamics AX
Good morning
AX supports basic operations on sets, here's a simple overwiew:
public static void OperationsOnSets(Args _args)
{
Set a = new Set(Types::Integer); //[1,3]
Set b = new Set(Types::Integer); //[2,3]
Set c = new Set(Types::Integer); //Result
;
{
Set a = new Set(Types::Integer); //[1,3]
Set b = new Set(Types::Integer); //[2,3]
Set c = new Set(Types::Integer); //Result
;
a.add(1);
a.add(3);
a.add(3);
b.add(2);
b.add(3);
b.add(3);
c = Set::union(a, b); //[1,3] U [2,3] Result: [1,2,3]
c = Set::intersection(a, b); //[1,3] ∩ [2,3] Result: [3]
c = Set::difference(a, b); //[1,3] - [2,3] Result: [1]
}
c = Set::intersection(a, b); //[1,3] ∩ [2,3] Result: [3]
c = Set::difference(a, b); //[1,3] - [2,3] Result: [1]
}
本文介绍了 Dynamics AX 中集合的基本操作,包括并集、交集和差集的实现方式。通过具体示例展示了如何使用这些内置函数来操作两个整数集合。

被折叠的 条评论
为什么被折叠?



