Public Function CompareLikeDataType( _
ByVal vOne As Variant _
, ByVal vTwo As Variant _
, Optional ByVal vCompare As Variant _
) As Integer CompareLikeDataType("ALL", "all", vbBinaryCompare) = -1
CompareLikeDataType("all", "ALL", vbBinaryCompare) = 1
CompareLikeDataType("ALL", "all", vbTextCompare) = 0
CompareLikeDataType("3", 3) = 1
CompareLikeDataType(Null, 3) = -1See also: CompareLikeDataTypeFast Function
CompareCoerceDataType Function
CompareExactDataType Function
EqualLikeDataType 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 + + + 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 comparisonCopyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.