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

Equal Like Data Type Fast Function
Comparisons Class

Public Function EqualLikeDataTypeFast( _
      ByRef vOne As Variant _
    , ByRef vTwo As Variant _
    , ByRef vCompare As VbCompareMethod _
    ) As Boolean

Return True if the values vOne and vTwo equal each other, otherwise return False.
Compares values with similar data types, but never considers strings equal to numbers.
Faster version of the EqualLikeDataType function which has more-restrictive argument types.

Examples:
    EqualLikeDataTypeFast("ALL", "all", vbBinaryCompare) = False
    EqualLikeDataTypeFast("all", "ALL", vbBinaryCompare) = False
    EqualLikeDataTypeFast("ALL", "all", vbTextCompare) = True
    EqualLikeDataTypeFast("3", 3, vbTextCompare) = False
See also:
    EqualLikeDataType Function
    CompareLikeDataTypeFast Function
    StrComp Function (Visual Basic)
Function returns:
    True  if vOne =  vTwo
    False if vOne <> vTwo
See the following table which describes how comparisons are made depending upon data type of arguments.
Summary: With Number/Date and Number/Date, use numeric comparison. With Number/Date and String, COMPARE THE VARTYPE. With String and String, use string comparison.
vOne: First of two values to be compared.
vTwo: Second of two values to be compared.
vCompare: Specifies the comparison type and sort order/collating sequence used when comparing string values.
Return value:
          vTwo
           D S
    vOne D n F
         S F s
VarType Codes:
    D = Date/Numeric
    S = String
Action Codes:
    F = Return False
    s = Do String comparison with StrComp
    n = Do numeric/Date comparison

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