Move(Field: ITableField, Position: Integer);
Field is a table field.
Position is a position in index.
The Move method moves table field into index.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Table: ITable;
Index: ITableIndex;
IndexFields: ITableIndexFields;
Field: ITableField;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("TABLE_1").Edit;
Table := MObj As ITable;
Index := Table.Indexes.Item(0);
IndexFields := Index.Fields;
Field := IndexFields.Item(0);
IndexFields.Move(Field, IndexFields.Count - 1);
MObj.Save;
End Sub Main;
After executing the example, in index the first table field is moved on last position.
See also: