DictEnum.values Method

Definition

Returns the number of items in the enumeration.

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

Returns

The number of items in the enumeration.

Remarks

Because values must be unique, the number of values is the same as the number of items.

The following example shows how to retrieve the number of items in an enumeration and use that value in a loop.

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

Applies to