createIterator

createIterator(): Iterator abstract;

The createIterator method of the Collection class creates an iterator for the Collection class and its subclasses. Use an iterator associated with the collection to remember the current position in the collection. (For details about iterators, see the Iterator class.)

The following example shows the use of the iterator.

vars
    iter : Iterator;
begin
    iter := company.allEmployees.createIterator;
    while iter.next(emp) do
        ...
    endwhile;
epilog
    delete iter;
end;