IDimSelection.Iterator

Syntax

Iterator(Elements: IDimElementArray): IDimIterator;

Parameters

Elements — array of elements, presence of which is to be checked.

Description

The Iterator property checks the presence of elements that are passed by the Elements parameter in the selection, and returns the iterator containing general elements.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Selection: IDimSelection;
    DimArr: IDimElementArray;
    Iter: IDimIterator;
Begin
    MB := MetabaseClass.Active;
    Dimen := MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Selection := Dimen.CreateSelection;
    Selection.SelectElement(10False);
    Selection.SelectElement(15False);
    Selection.SelectElement(20False);
    Selection.SelectElement(25False);
    Selection.SelectElement(30False);
    DimArr := Dimen.Elements.Children(10);
    Iter := Selection.Iterator(DimArr);
    Iter.First;
    While Iter.Next Do
        Debug.WriteLine(Dimen.Elements.Name(Iter.Element));
    End While;
End Sub UserProc;

After executing the example the Iter iterator contains general elements of the Selection selection and of the DimArr array. Names of the elements given are shown in the development environment console.

See also:

IDimSelection