Share via


DictEnum.index2Name(Int32) Method

Definition

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

public:
 virtual System::String ^ index2Name(int _index);
public virtual string index2Name (int _index);
abstract member index2Name : int -> string
override this.index2Name : int -> string
Public Overridable Function index2Name (_index As Integer) As String

Parameters

_index
Int32

The zero-based index of the enumeration in the AOT.

Returns

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

Remarks

For backward compatibility with earlier versions of Finance and Operations, "Name" in DictEnum::value2Name refers to the enumeration item's label property. To make your code more readable, use the DictEnum::value2Label method instead of the DictEnum::value2Name method. To retrieve the value of the name property of the enumeration item as shown in the AOT, use the DictEnum::value2Symbol method.

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.index2Name(i); 
}

Applies to