MoveTo(Element: Integer): Boolean;
Element — element index in the array.
The MoveTo method places iterator cursor to dictionary element with the Element index and returns True if the operation is successful.
Sub Main;
Var
MB: IMetabase;
Dimen: IDimInstance;
Elem: IDimElements;
ElemArr: IDimElementArray;
Iter: IDimIterator;
i: Integer;
Begin
MB:=MetabaseClass.Active;
Dimen:=MB.ItemById("D_TO").Open(Null) As IDimInstance;
Elem:=Dimen.Elements;
ElemArr:=Elem.Children(10);
Iter:=ElemArr.Iterator;
If Iter.MoveTo(35) Then
i:=Iter.Position;
Else
i:=-1;
End If;
End Sub Main;
Executing the example creates an iterator based on the array of elements named ElemArr. If the iterator includes dictionary element with the index 35, cursor is placed at this element, and the "i" variable contains the number of this element.
See also: