SetEnumerator.reset Method [AX 2012]
Moves the enumerator to the start of the set.
The following example creates a set and then creates an enumerator for the set. It uses the reset method to move to the start of the set and then uses the moveNext method to move to the first element in the set.
{
Set mySet = new Set(Types::Integer);
SetEnumerator enumerator;
int i;
// Add some elements to the set.
for (i = 0; i < 10; i++)
{
mySet.add(i);
}
// Set the enumerator.
enumerator = mySet.getEnumerator();
// Go to beginning of enumerator.
enumerator.reset();
// Go to the first element in the set.
enumerator.moveNext();
// Print the first item in the set.
print enumerator.toString();
pause;
}
Community Additions
ADD
Show: