IUserDimBlocks.FindByKey

Syntax

FindByKey(BlockKey: Integer): IUserDimBlock;

Parameters

BlockKey — block key, used as a base for search.

Description

The FindByKey method searches and returns an object containing calculated dictionary block. The search is based on the key, passed by the BlockKey parameter.

Example

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

UsDim: IUserDimension;

UsDimBlocks: IUserDimBlocks;

UsDimBlock: IUserDimBlock;

s: String;

Begin

MB:=MetabaseClass.Active;

MObj:=MB.ItemById("USER_DIM").Edit;

UsDim:=MObj As IUserDimension;

UsDimBlocks:=UsDim.Blocks;

UsDimBlock:=UsDimBlocks.FindByKey(5289);

If UsDimBlock<>Null Then

s:=UsDimBlock.Name;

Else

s:="It Is not found";

End If;

MObj.Save;

End Sub Main;

After executing the example the method searches for the block with the 5289 key, and if the search is successful, the "s" variable contains the name of the block found. Calculated dictionary identifier: USER_DIM.

See also:

IUserDimBlocks