CopyTo(Dest: IDimElementArray; Replace: Boolean);
Dest. Consumer to which elements must be copied.
Replace. Parameter determining whether elements in consumer will be replaced. If True, consumer is cleared before copy, if False - elements are added to the end of array.
The CopyTo method copies an array of elements to the Dest consumer.
Sub Main;
Var
MB: IMetabase;
Dimen: IDimInstance;
Elem: IDimElements;
ElemArr, ElemArr1: IDimElementArray;
Begin
MB:=MetabaseClass.Active;
Dimen:=MB.ItemById("D_TO").Open(Null) As IDimInstance;
Elem:=Dimen.Elements;
ElemArr:=Elem.Children(10);
ElemArr1:=Elem.Children(11);
ElemArr.CopyTo(ElemArr1, True);
End Sub Main;
After executing the example elements of the ElemArr array are copied to the ElemArr1 array. ElemArr1 contents is deleted before copying.
See also: