Click or drag to resize

Max Function

X#
Return the larger of 2 values.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION Max(
	uValue1 AS USUAL,
	uValue2 AS USUAL
) AS USUAL
Request Example View Source

Parameters

uValue1
Type: Usual
The first value to compare.
uValue2
Type: Usual
The second value to compare.
This must be of the same type as uValue1 except that numerics of different types are allowed.

Return Value

Type: Usual
The larger of the 2 arguments.
The value returned is the same type as the larger argument.
Remarks
The inverse of Max() is Min(), which returns the smaller of 2 expressions.
Examples
In these examples Max() returns the larger of 2 numbers:
X#
1? MAX(99, 100)                        // 100
2? MAX(100, 99)                        // 100
In these examples Max() compares date values:
X#
1? TODAY()                            // 05/27/93
2? MAX(TODAY(), TODAY() + 1)            // 05/28/93
See Also