| IEnumerator |
The enumerator can be used manually to enumerate through the values of a list, or it can be wrapped in a custom enumerator to allow it to be used in the For..Each context.
To use an IEnumerator object in For..Each, call the CreateEnumerator method
passing in the IEnumerator object. The returned value is then returned in
the standard NewEnum(-4) function called by For..Each. The enumeration will then
be delegated to the custom IEnumerator object.
Example
Public Function NewEnum() As IUnknown
Dim e As New MyEnumerator
e.Init Me
Set NewEnum = CreateEnumerator(e)
End Function
See Also
| Name | Description |
|---|---|
Current (get) | This returns the current item of the enumeration. The current item is called after a successful MoveNext. |
| Name | Description |
|---|---|
MoveNext | Requests the enumerator moves to the next item being enumerated. Returns True on success, False otherwise. This is called prior to Current. If this is successful, Current will be called. |
Reset | Requests the enumerator resets itself to begin enumerating from the beginning. |