back

back(value: Any output): Boolean updating;

The back method of the Iterator class accesses entries in reverse order one at a time in the collection to which the iteration is attached. This method returns true when it has returned a value or it returns false when the iterator is positioned in front of the first entry in the collection.

The value parameter receives the prior entry in the collection and must be of the same type as the members in the collection. The following example shows the use of the back method.

getRelativePosition(pObj: Object): Integer;
vars
    coll : Collection;
    pos  : Integer;
    obj  : Object;
    iter : Iterator;
begin
    coll := self.getCollection;
    iter := coll.createIterator;
    pos  := coll.size;
    while iter.back(obj) do
        pos := pos - 1;
        if obj = pObj then
            break;
        endif;
    endwhile;
    return pos;
end;