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

Is Between Function
Comparisons Class

Public Function IsBetween( _
      ByVal vCheck As Variant _
    , ByVal vLow As Variant _
    , ByVal vHigh As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Return True if vCheck is between vLow and vHigh inclusive.
Attempts to fix-up different types of values to compatible data types.

Examples:
    IsBetween(5, 6.0, 7) = False
    IsBetween(5, 4.5, 7) = True
    IsBetween("S", "A", "Z", vbBinaryCompare) = True
    IsBetween("s", "A", "Z", vbBinaryCompare) = False
    IsBetween("s", "A", "Z", vbTextCompare) = True
See also:
    RangeComp Function
    IsWithinPlusOrMinusOf Function
    FixUpVariantToRange Subroutine
vCheck: The value which is checked to see if it falls within the inclusive range. Function returns Null if vCheck is Null.

vLow: The lower bound of the range which vCheck must be within for the function to return True. Function returns Null if vLow is Null.

vHigh: The upper bound of the range which vCheck must be within for the function to return True. Function returns Null if vHigh is Null.

vCompare: Specifies the sort order/collating sequence used when comparing string values. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.
If the arguments vCheck, vLow, and vHigh are non-Null, then this function uses the CompareLikeDataType function to determine if vCheck is within the range.

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