Returns the next item in the enumeration. If there are no more items, the method should raise an exception.
To check if there are more items, use the CommonInterfaces.IIterator.HasMoreElements method. The NextElement method advances its place in the enumeration and then returns that item. Every call to NextElement returns a new item (until the end of the enumeration). If you wish to access the current item multiple times in a loop, use the CommonInterfaces.IIterator.CurrentElement method.
Namespace: GHashTable
Delphi |
public |
Return Value
Type: TIteratorElement
The following code gives a sample implementation from the TListIterator object, List is the TList that is supplying the underlying elements and Index is a hidden index for the enumeration: Delphi |
begin |