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 Main;

Var

MB: IMetabase;

Dimen: IDimInstance;

Selection: IDimSelection;

DimArr: IDimElementArray;

Iter: IDimIterator;

Begin

MB := MetabaseClass.Active;

Dimen := MB.ItemById("D_TO").Open(Null) As IDimInstance;

Selection := Dimen.CreateSelection;

Selection.SelectElement(10, False);

Selection.SelectElement(15, False);

Selection.SelectElement(20, False);

Selection.SelectElement(25, False);

Selection.SelectElement(30, False);

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 Main;

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