back

back(value: Any output): Boolean;

The back method of the SetMergeIterator class accesses entries in reverse order one at a time in the sets comprising the merged iterator view.

This method returns true when a prior entry is found, and the entry is assigned to the value parameter. It returns false when a prior entry is not found because the iterator is positioned before the first entry in the merged view, and the value parameter becomes a null reference.

When the back method is used with an iterator where that iterator has been passed to a method as a method parameter, the iterator must be defined as a usage input; that is, the iterator cannot be modified by the called method.

The following example shows the use of the back method.

getReversedPosition(pObj: Object; pIter: SetMergeIterator input): Integer;
vars
    pos : Integer;
    obj : Object;
begin
    while pIter.back(obj) do
        pos := pos - 1;
        if obj = pObj then
            return pos;
        endif;
    endwhile;
    return 0;
end;