MapEnumerator.currentValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the value from the (key, value) pair that is currently pointed to by the enumerator.
public:
System::Object ^ currentValue();
public object currentValue ();
member this.currentValue : unit -> obj
Public Function currentValue () As Object
Returns
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.
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;
}