<-- Previous || Up || Next -->

Range Comp Function
Math Arithmetic Class

Public Function RangeComp( _
      ByVal vA As Variant _
    , ByVal vX As Variant _
    , ByVal vB As Variant _
    ) As Variant

"Range Compare" or "Range Comparison"
Determine is X is below, within, or above the range from A through B.

Summary:
    If X < A: Return -1.
    If A <= X <= B: Return 0.
    If X > B: Return 1.
Examples:
    RangeComp(20, 10, 30) = -1
    RangeComp(20, 20, 30) = 0
    RangeComp(20, 25, 30) = 0
    RangeComp(20, 50, 30) = 1
See also:
    Chi Function
    IsBetween Function
    IsWithinPlusOrMinusOf Function
    NumComp Function
    FixUpVariantToRange Subroutine
vA: The lower-bound of the range against which vX is compared. Function returns Null if vA is Null or cannot be fixed up to a number.

vX: Number that is checked to see if it is below, within, or above the range from A through B inclusive. Function returns Null if vX is Null or cannot be fixed up to a number.

vB: The upper-bound of the range against which vX is compared. Function returns Null if vA is Null or cannot be fixed up to a number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.