IStdDimOrders.FindByKey

Syntax

FindByKey(AttributeKey: Integer): IStdDimOrder;

Parameters

AttributeKey. Key of the attribute, by which the search is executed.

Description

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

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimens: IStandardDimension;
    DimAttrs: IStandardDimAttributes;
    DimOrd: IStdDimOrders;
    Order: IStdDimOrder;
    s: String;
Begin
    MB := MetabaseClass.Active;
    Dimens := MB.ItemById("TAB_DIM").Bind As IStandardDimension;
    DimAttrs := Dimens.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 UserProc;

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:

IStdDimOrders