IDimIterator.MoveTo

Syntax

MoveTo(Element: Integer): Boolean;

Parameters

Element — element index in the array.

Description

The MoveTo method places iterator cursor to dictionary element with the Element index and returns True if the operation is successful.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Elem: IDimElements;
    ElemArr: IDimElementArray;
    Iter: IDimIterator;
    i: Integer;
Begin
    MB:=MetabaseClass.Active;
    Dimen:=MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Elem:=Dimen.Elements;
    ElemArr:=Elem.Children(10);
    Iter:=ElemArr.Iterator;
    If Iter.MoveTo(35Then
        i:=Iter.Position;
    Else
        i:=-1;
    End If;
End Sub UserProc;

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:

IDimIterator