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

Max 2 Variant Function
Math Reals Class

Public Function Max2Variant( _
      ByVal vX As Variant _
    , ByVal vY As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

"Maximum Of Two Variant Values"
Return the maximum of two values.
Returns argument on left (vX) if arguments are equal.

    Max2Variant(23, 45) = 45
    Max2Variant(-12, 4) = 4
    Max2Variant(2%, 2#) = 2%
    Max2Variant(2#, 2%) = 2#
    Max2Variant("SA", "RO") = "SA"
    Max2Variant("SA", "ro") = "ro"
    Max2Variant("SA", "ro", vbTextCompare) = "SA"
See also:
    Max2VariantVerify Subroutine
    Max2Real Function
    Max3Variant Function
    Min2Variant Function
    Max2 Function
vX: First of two values, the maximum of which will be returned.
vY: Second of two values, the maximum of which will be returned.
vCompare: specifies the type of string comparison used to determine if strings match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.
Note: Arguments are compared using the CompareLikeDataType function; see it for more details of how arguments are fixed up and comparisons are performed.
Note: This function does not support three-valued logic because of the way that the CompareLikeDataType function treats Null values.

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