Show/Hide Toolbars

RiverSoftAVG Products Help

The TStringsIterator object implements the CommonInterfaces.IIterator , CommonInterfaces.IObjectIterator, and CommonInterfaces.IStringIterator interfaces for an underlying TStrings Object. It provides an enumeration of all the items in a TStrings object or its descendants. It effectively hides the underlying implementation, in this case a TStrings, while still allowing access to all the items stored in the implementation.

The object provides functionality similar to an Enumeration in Java.

To use the iterator is simple, get the iterator as an IIterator, IObjectIterator, or IStringIterator interface and then keep calling the    NextElement method of the interface until the    HasMoreElements method returns False. The iterator works by giving you the next element until the end of the list, there is no provision for getting the previous element. The iterator manages its own memory and will free itself when it is completely dereferenced (as long as you use an interface to access it). The NextElement and CurrentElement methods of the IObjectIterator interface have been mapped to the    NextElementO and    CurrentElementO of this object; it is completely transparent to the user of the interface. Similarly, the    NextElementP and    CurrentElementP methods implement the NextElement and CurrentElement methods of the IIterator interface.


The enumeration guarantees no ordering in the manner that the next element returns items. It just guarantees all items will be returned eventually, with no item appearing twice.

Namespace: RSInterfaceCollections

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb