IDimIndexesInstance.FindByKey

Syntax

FindByKey(IndexKey: Integer): IDimIndexInstance;

Parameters

IndexKey — index key on which the search is based.

Description

The FindByKey method searches and returns an object containing dictionary index. The search is based on the key passed as the IndexKey parameter.

Example

Sub Main;

Var

MB: IMetabase;

Dimen: IDimInstance;

Indxs: IDimIndexesInstance;

Index: IDimIndexInstance;

s: String;

Begin

MB:=MetabaseClass.Active;

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

Indxs:=Dimen.Indexes;

If Indxs.Count<>0 Then

Index:=Indxs.FindByKey(4903);

If Index<>Null Then

s:=Index.Index.Id;

End If;

End If;

End Sub Main;

After executing the example the method searches for index with the 4903 key, and the "s" variable contains the identifier of the found index if the search is successful.

See also:

IDimIndexesInstance