Private Function Min3VariantVerify() ' Test the Min3Variant function. Debug.Assert Min3Variant(-2, 2, 0) = -2 Debug.Assert Min3Variant(0, -2, 2) = -2 Debug.Assert Min3Variant(2, 0, -2) = -2 ' Return leftmost argument. Debug.Assert VarType(Min3Variant(2&, 2#, 2!)) = vbLong Debug.Assert VarType(Min3Variant(2#, 2!, 2&)) = vbDouble Debug.Assert VarType(Min3Variant(2!, 2&, 2#)) = vbSingle ' Perform Binary comparisons. Debug.Assert Min3Variant("JOE", "Tom", "Joe") = "JOE" Debug.Assert Min3Variant("Joe", "JOE", "Tom") = "JOE" Debug.Assert Min3Variant("Tom", "Joe", "JOE") = "JOE" ' Explicit Text comparisons. Debug.Assert Min3Variant("JOE", "Joe", "Tom", vbTextCompare) = "JOE" Debug.Assert Min3Variant("Joe", "JOE", "Tom", vbTextCompare) = "Joe" Debug.Assert Min3Variant("Tom", "JOE", "Joe", vbTextCompare) = "JOE" Debug.Assert Min3Variant("Tom", "Joe", "JOE", vbTextCompare) = "Joe" End Function
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.