IDimIndexInstance.LookUp

Syntax

LookUp(IndexAttributesValues: Variant): Integer;

Parameters

IndexAttributesValues — values of attributes on which the search is based.

Description

The LookUp method searches for dictionary element. Searched data is passed by the IndexAttributesValues parameter.

Comments

The method returns the number of the found element (numeration starts with zero).

The method returns -1 if the element with required values of attributes is not found.

Example

Sub Main;

Var

MB: IMetabase;

Dimen: IDimInstance;

IndxsInst: IDimIndexesInstance;

IndexInst: IDimIndexInstance;

Arr: Array Of Variant;

i: Integer;

Begin

MB:=MetabaseClass.Active;

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

Arr:=New Variant[2];

IndxsInst:=Dimen.Indexes;

If IndxsInst.Count<>0 Then

IndexInst:=IndxsInst.Item(0);

Arr[0]:=10;

Arr[1]:=10;

i:=IndexInst.LookUp(Arr);

End If;

End Sub Main;

After executing the example the method searched in attributes of the first dictionary index. Target attribute values are stored in the Arr array. If the search is successful, the "i" variable contains the number of the found element.

See also:

IDimIndexInstance