LookUp(IndexAttributesValues: Variant): Integer;
IndexAttributesValues — values of attributes on which the search is based.
The LookUp method searches for dictionary element. Searched data is passed by the IndexAttributesValues parameter.
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.
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: