Show contents 

Db > Db Assembly Interfaces > ITableIndexFields > ITableIndexFields.Add

ITableIndexFields.Add

Syntax

Add(Value: ITableField);

Parameters

Value is a table field.

Description

The Add method adds a table field into index.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Object: IMetabaseObject;
    Table: ITable;
    Index: ITableIndex;
    IndexFields: ITableIndexFields;
    Field: ITableField;
Begin
    MB:=MetabaseClass.Active;
    Object:=MB.ItemById("TABLE_1").Edit;
    Table:=Object As ITable;
    Field:=Table.Fields.Item(2);
    Index:=Table.Indexes.Item(0);
    IndexFields:=Index.Fields;
    IndexFields.Add(Field);
    Object.Save;
End Sub UserProc;

After executing the example, in the first index the third field of the table is added. The table identifier is Table_1.

See also:

ITableIndexFields