Show contents 

Dimensions > Dimensions Assembly Interfaces > IDimElementArray > IDimElementArray.Remove

IDimElementArray.Remove

Syntax

Remove(Element: Integer): Boolean;

Parameters

Element — element index in the array.

Description

The Remove method removes element with the Element index from the array and returns True if element is successfully removed.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Elem: IDimElements;
    ElemArr: IDimElementArray;
    s: String;
Begin
    MB:=MetabaseClass.Active;
    Dimen:=MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Elem:=Dimen.Elements;
    ElemArr:=Elem.Children(10);
    If ElemArr.Remove(ElemArr.Count-1Then
        s:="Removed";
    Else
        s:="It is not removed";
    End If;
End Sub UserProc;

After executing the example the "s" variable contains Removed if the last array element is successfully removed.

See also:

IDimElementArray