Move(IndexFrom: Integer; IndexTo: Integer);
IndexFrom - index of position from which the attribute is to be moved.
IndexTo - index of position to which the attribute is to be placed.
The Move method changes attributes' positions in sorting list thus changing priority of sorting by some attribute.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dimens: IStandardDimension;
DimAttrs: IStandardDimAttributes;
DimOrd: IStdDimOrders;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("TAB_DIM").Edit;
Dimens := MObj As IStandardDimension;
DimAttrs := Dimens.Attributes;
DimOrd := DimAttrs.Orders;
DimOrd.Move(0, DimOrd.Count - 1);
MObj.Save;
End Sub Main;
After executing the example the first attribute in the sorting list is moved to the last position.
See also: