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

Max 2 Variant Verify Function
Math Reals Class

Private Function Max2VariantVerify()
    ' Test the Max2Variant function.

    Debug.Assert Max2Variant(2, -2) = 2
    Debug.Assert Max2Variant(-2, 2) = 2

    ' Return leftmost argument.
    Debug.Assert VarType(Max2Variant(2&, 2#)) = vbLong
    Debug.Assert VarType(Max2Variant(2#, 2&)) = vbDouble

    ' Perform Binary comparisons.
    Debug.Assert Max2Variant("Joe", "JOE") = "Joe"
    Debug.Assert Max2Variant("JOE", "Joe") = "Joe"

    ' Explicit Text comparisons.
    Debug.Assert Max2Variant("Joe", "JOE", vbTextCompare) = "Joe"
    Debug.Assert Max2Variant("JOE", "Joe", vbTextCompare) = "JOE"

End Function

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