Dimensions > Dimensions Assembly Interfaces > IDimElementArray > IDimElementArray.Find
Find(Element: Integer): Integer;
Element — element index in the array.
The Find method searches for dictionary element with the index Element in array. If successful, it returns element index in the array; otherwise it returns "-1".
Sub UserProc;
Var
MB: IMetabase;
Dimen: IDimInstance;
Elem: IDimElements;
ElemArr: IDimElementArray;
i: Integer;
Begin
MB:=MetabaseClass.Active;
Dimen:=MB.ItemById("D_TO").Open(Null) As IDimInstance;
Elem:=Dimen.Elements;
ElemArr:=Elem.Children(10);
i:=ElemArr.Find(96);
End Sub UserProc;
After executing the example the method searches dictionary element with the index 96 in the ElemArr array. If the search is successful, the "i" variable contains index of array element that corresponds to the specified dictionary element.
See also: