DictIndex.field Method
Returns the ID of the specified field in the index.
Syntax
public FieldId field(int fieldNumber)
Run On
Called
Parameters
- fieldNumber
Type: int
The one-based index of the field in the index.
Return Value
Type: FieldId Extended Data Type
The ID of the field that is specified by fieldNumber; 0 (zero) if fieldNumber does not represent a valid field.
Examples
The following example shows the retrieval of each field in an index. The name of each field is displayed by using a loop.
Dictionary dict;
DictTable table;
DictIndex idx;
DictField field;
int i;
dict = new Dictionary();
table = new DictTable(dict.tableName2Id("Address"));
idx = new DictIndex(table.id(), table.indexName2Id("AddrIdx"));
for (i=1; i <= idx.numberOfFields(); i++)
{
field = new DictField(table.id(), idx.field(i));
print field.name();
}