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