Set::create Method [AX 2012]

Creates a set from the container obtained from a prior call to the Set.pack method.

client server public static Set create(container container)

Run On

Called

Parameters

container
Type: container
The container that holds the packed set.

Return Value

Type: Set Class
A set equal to the one that was packed into the container.

If the values are objects, the objects must have an unpack method that is called to reestablish their internal state from the container.

The following example creates a set and packs it into a container. The create method is then used to unpack the container and create a set identical to the original one.

{ 
    Set is1, is = new Set (Types::Integer); 
    int i; 
    container packedSet; 
    ; 
  
    // Add 10 integers (0 - 9) to the set 
    for (i = 1; i <= 10; i++) 
    { 
        is.add(i); 
    } 
  
    // Pack the set into a container... 
    packedSet = is.pack(); 
  
    // ... and restore it 
    is1 = Set::create(packedSet); 
    print is1.toString(); 
    pause; 
}
Show: