次の方法で共有


List.pack Method

Definition

Serializes the current instance of the List class.

public:
 cli::array <System::Object ^> ^ pack();
public object[] pack ();
member this.pack : unit -> obj[]
Public Function pack () As Object()

Returns

Object[]

A container that contains the current instance of the List class.

Remarks

The container created by this method contains 3 elements before the first element from the list:

  • A version number for the container
  • An integer that identifies the data type of the list elements
  • The number of elements in the list

If the elements in the list are objects, packing is performed by calling the pack method successively on each object to yield a subcontainer. The list can be retrieved from the packed container by using the List.create method.

The following example creates a list of records and passes in the packed list as a parameter for creating a new projReverseMarking object.

public boolean canClose() 
{ 
    ProjReverseMarking      projReverseMarking; 
    boolean                 canClose; 
    List                    list; 
    canClose = super(); 
    if (element.closedOk() && canClose) 
    { 
        List = new List(Types::Record); 
        while select tmpFrmVirtualLines 
        { 
            list.addEnd(tmpFrmVirtualLines); 
        } 
        projReverseMarking = new ProjReverseMarking(list.pack()); 
        projReverseMarking.run(); 
    } 
    return canClose; 
}

Applies to