Compares source and target, returning -1 if source is before target, 0 if they are the same, 1 if source is after target. The value is reversed (so -1 changed to 1, 1 changed to -1) if: - Comparator is descending, but Collection is not reversed - Comparator is ascending, but Collection is reversed |
%REM The following code is abbreviated code from Collection.getIndex. It compares each element against the value being checked, and if it matches, returns the current index. %END REM Public Function getIndex(checkValue as Variant) as Variant ForAll elem in Me.p_content) If (Me.Comparator.compareAscDesc(checkValue, elem, Me.p_isCollReversed) = 0) Then Return ListTag(elem) End ForAll End Function |