IDimOrders.FindByKey

Syntax

FindByKey(AttributeKey: Integer): IDimOrder;

Parameters

AttributeKey - key of the attribute on which the search is based.

Description

The FindByKey method searches and returns attribute included into sorting list. The key value of which is searched for, is passed by the AttributeKey parameter.

Example

Sub Main;

Var

MB: IMetabase;

DimModel: IDimensionModel;

DimAttrs: IDimAttributes;

DimOrd: IDimOrders;

Order: IDimOrder;

s: String;

Begin

MB := MetabaseClass.Active;

DimModel := MB.ItemById("D_TO").Bind As IDimensionModel;

DimAttrs := DimModel.Attributes;

DimOrd := DimAttrs.Orders;

Order := DimOrd.FindByKey(DimAttrs.Name.Key);

If Order <> Null Then

s := Order.ReverseOrder.ToString;

Else

s := "Attribute does not fall into list of the sorting";

End If;

End Sub Main;

After executing the example the attribute with Name function is searched for in the sorting list; if the search is successful, the "s" variable contains direction of sorting by this attribute.

See also:

IDimOrders