Operações básicas com Sets no Dynamics AX
25
Jan
2009
Posted by: Ricardo Pichler in: X++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| 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
;
a.add(1);
a.add(3);
b.add(2);
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]
} |
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
;
a.add(1);
a.add(3);
b.add(2);
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]
}
Fonte.
[]s
Ricardo Pichler
Leave a reply