MoveTo(FromIndex: Integer; ToIndex: Integer);
FromIndex. Index of replaced slice.
ToIndex. Index of collection position, where the slice must be placed.
The MoveTo method moves the slice to the specified collection.
Indexing of slices in the collection is continuous and starts with zero. Value of the ToIndex parameter must be less than value of IMsFormulaTransformSlices.Count property.
Executing the example requires a modeling container with the CONT_MODEL identifier, that contains a multidimensional model with the OBJ identifier. Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
msKey: Integer;
hModel: IMetabaseObjectDescriptor;
g_oModel: IMsModel;
transf: IMsFormulaTransform;
oVar: IMsFormulaTransformVariable;
sl: IMsFormulaTransformSlices;
Begin
mb := metabaseClass.Active;
msKey := mb.GetObjectKeyById("CONT_MODEL");
hModel := mb.ItemByIdNamespace("OBJ15033", msKey);
g_oModel := hModel.Edit As IMsModel;
transf := g_oModel.Transform;
oVar := transf.Inputs.Item(0);
sl := oVar.Slices;
sl.MoveTo(0, sl.Count - 1);
(hModel As IMetabaseObject).Save;
End Sub Button1OnClick
After executing the example, the first slice is placed to the end of the input variable collection. Other slices are moved to the beginning of collection to one position.
See also: