Remove(Index: Integer): Boolean;
Index. Index of composite structure in the collection.
The Remove method removes composite structure from the collection by its index.
Value of the Index parameter must be a non-negative number but less than value of the IVirtualCubeCompounds.Count property. Index of the first object in the collection is 0, of the last one - IVirtualCubeCompounds.Count - 1. Index numbering is continuous.
If structure removal completed successfully, the method returns True, value of the IVirtualCubeCompounds.Count property is decreased by one; otherwise - False.
Executing the example requires that the repository contains a virtual cube with the CUBE_VIRT identifier. Also, add links to the Metabase, Cubes system assemblies.
Sub UserProc;
Var
mb: IMetabase;
VirtCube: IVirtualCube;
Compounds: IVirtualCubeCompounds;
VCompound: IVirtualCubeCompound;
Begin
Mb := MetabaseClass.Active;
VirtCube := Mb.ItemById("CUBE_VIRT").Edit As IVirtualCube;
Compounds := VirtCube.Compounds;
VCompound := Compounds.Item(Compounds.Count - 1);
If VCompound <> Null Then
Debug.WriteLine(Removal completed successfully: + Compounds.Remove(Compounds.Count - 1).ToString);
End If;
(VirtCube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the last composite structure is removed from the virtual cube. Removal results are displayed in the console window.
See also: