Set.create(Object[]) Method

Definition

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

public:
 static Microsoft::Dynamics::Ax::Xpp::Set ^ create(cli::array <System::Object ^> ^ _container);
public static Microsoft.Dynamics.Ax.Xpp.Set create (object[] _container);
static member create : obj[] -> Microsoft.Dynamics.Ax.Xpp.Set
Public Shared Function create (_container As Object()) As Set

Parameters

_container
Object[]

The container that holds the packed set.

Returns

Set

A set equal to the one that was packed into the container.

Remarks

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; 
}

Applies to