Share via


DictTable.Indexunique Method

Definition

Returns the ID of the unique index for the table.

public:
 virtual int Indexunique();
public virtual int Indexunique ();
abstract member Indexunique : unit -> int
override this.Indexunique : unit -> int
Public Overridable Function Indexunique () As Integer

Returns

The ID of the unique index for the table.

Remarks

When there is more than one unique index on the table, the return value is one of the following:

  • The index that has the RecID column.
  • If no index has a record ID, the index that has the shortest size, based on the total size of columns.
  • If multiple indexes match with regard to the shortest size, the index that was added first.

The following example shows the retrieval of the unique index for a table.

DictTable dt; 
DictIndex di; 
dt = new DictTable(tablenum(SysUserInfo)); 
if (dt) 
{ 
     di = dt.indexObject(dt.indexUnique()); 
     if (di) 
     { 
        print di.name(); 
     } 
}

Applies to