Remove(Index: Integer): Boolean;
Index. Index of the set in the collection.
The Remove method removes the set from the collection by its index.
If the deletion was successful, the method returns True, otherwise it returns False.
Executing the example requires that the repository contains the CONT_MODEL modeling container with the BINREG model that uses binary regression method for calculation. This container should also have the X2 variable.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
SpaceDescr: IMetabaseObjectDescriptor;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
VarTrans: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Binary: IMsBinaryRegressionTransform;
Explanatories: IMsCompositeFormulaTermSetList;
Begin
MB := MetabaseClass.Active;
SpaceDescr := mb.ItemById("CONT_MODEL");
MObj := MB.ItemByIdNamespace("BinReg",SpaceDescr.Key).Edit;
Model := MObj As IMsModel;
Trans := Model.Transform;
VarTrans := Trans.Outputs.Item(0);
Tree := VarTrans.SlicesTree(VarTrans);
Slice := Tree.CreateSlice(1);
Selector := Model.Transform.CreateSelector;
Selector.Slice := Slice;
Formula := Model.Transform.Transform(Selector);
Binary := Formula.Method As IMsBinaryRegressionTransform;
Explanatories := Binary.Explanatories;
Debug.WriteLine("Explanatory series terms:");
If Explanatories.Remove(0) Then
Debug.WriteLine("First set from the collection was successfully removed");
Else System.Diagnostics.Debug.WriteLine("First set was not removed from the collection");
End If;
MObj.Save;
End Sub;
After executing the example, the first set from the collection is removed.
See also: