Share via


DictEnum.index2Label Method

Returns the label of the enumeration item that is specified by an index.

Syntax

public str index2Label(int index)

Run On

Called

Parameters

  • index
    Type: int
    The zero-based index of the enumeration in the AOT.

Return Value

Type: str
The label of the enumeration item that specified by index; an empty string if index does not reference a valid enumeration item.

Examples

The following example shows the retrieval of the label for items in an enumeration.

DictEnum de; 
int      i; 
 
de = new DictEnum(enumName2Id("ActionType")); 
for (i=0; i < de.values(); i++) 
{ 
    print int2str(i) + ", " + de.index2Label(i); 
}

See Also

Reference

DictEnum Class