Show contents 

Dimensions > Dimensions Assembly Interfaces > IDimElementArray > IDimElementArray.CopyTo

IDimElementArray.CopyTo

Syntax

CopyTo(Dest: IDimElementArray; Replace: Boolean);

Parameters

Dest. Data consumer, to which elements must be copied.

Replace. Parameter that determines whether data consumer elements will be replaced. If the parameter is set to True, data consumer is cleared before copying. If the parameter is set to False, elements are added to the end of the array.

Description

The CopyTo method copies an array of elements to the Dest consumer.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Elem: IDimElements;
    ElemArr, ElemArr1: IDimElementArray;
Begin
    MB:=MetabaseClass.Active;
    Dimen:=MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Elem:=Dimen.Elements;
    ElemArr:=Elem.Children(10);
    ElemArr1:=Elem.Children(11);
    ElemArr.CopyTo(ElemArr1, True);
End Sub UserProc;

After executing the example elements of the ElemArr array are copied to the ElemArr1 array. ElemArr1 contents is deleted before copying.

See also:

IDimElementArray