FindByKey(AttributeKey: Integer): IStdDimOrder;
AttributeKey - key of the attribute on which the search is based.
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.
Sub Main;
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 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: