Public Function CompareCoerceDataType( _ ByVal vOne As Variant _ , ByVal vTwo As Variant _ , Optional ByVal vCompare As Variant _ ) As Integer
CompareCoerceDataType("ALL", "all", vbBinaryCompare) = -1 CompareCoerceDataType("all", "ALL", vbBinaryCompare) = 1 CompareCoerceDataType("ALL", "all", vbTextCompare) = 0 CompareCoerceDataType("3", 3) = 0 CompareCoerceDataType(Null, 3) = -1See also:
CompareExactDataType Function CompareLikeDataType Function EqualCoerceDataType Function StrComp Function (Visual Basic)Function returns:
-1 if vOne < vTwo 0 if vOne = vTwo 1 if vOne > vTwoSee the following table which describes how comparisons are made depending upon data type of arguments.
vTwo E N D S vOne E 0 - - - N + 0 - - D + + n s S + + s sVarType Codes:
E = Empty N = Null D = Date/Numeric S = StringAction Codes:
0 = Return 0 - = Return -1 + = Return 1 s = Do String comparison with StrComp n = Do numeric/Date comparison
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.