Share via


MapEnumerator.currentValue Method

Returns the value from the (key, value) pair that is currently pointed to by the enumerator.

Syntax

public anytype currentValue()

Run On

Called

Return Value

Type: anytype
The value from the map element that is currently pointed to by the enumerator.

Remarks

You must call the MapEnumerator.moveNext method before you call this method.

Examples

The following example searches through a map to find an element that has a value equal to that passed in as a parameter. The MapEnumerator.moveNext method is used to iterate through the map, and the currentValue method is used to test each value to see whether it matches the parameter.

private LabelType tableLabel(tableId _tableId) 
{ 
    LabelType     labelType; 
    MapEnumerator mapEnum; 
 
    mapEnum = tableAllMap.getEnumerator(); 
 
    while (mapEnum.moveNext()) 
    { 
        if (_tableId == mapEnum.currentValue()) 
        { 
            labelType = mapEnum.currentKey(); 
            break; 
        } 
    } 
    return labelType; 
}

See Also

MapEnumerator Class

MapEnumerator.currentKey Method