Share via


MapIterator.next Method

Moves the iterator to the next (key, value) pair.

Syntax

public void next()

Run On

Called

Remarks

You can use the MapIterator.more method to determine whether there are any more elements in the map.

Examples

The following example uses the next method to iterate through a map, and returns a list of all the elements in the map.

static str writeMap (Map m) 
{ 
    MapIterator it = new MapIterator(m); 
    str result; 
  
    while (it.more()) 
    { 
        result += it.key() + '\n' + it.value() + '\n'; 
        it.next(); 
    } 
    return result; 
}

See Also

MapIterator Class

MapIterator.more Method