Click or drag to resize

Min Function

X#
Return the smaller of 2 values.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION Min(
	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 smaller of the 2 arguments.
The value returned is the same type as the smaller argument.
Remarks
The inverse of Min() is Max(), which returns the larger of 2 expressions.
Examples
In these examples Min() returns the smaller of 2 numbers:
X#
1? MIN(99, 100)                    // 99
2? MIN(100, 99)                    // 99
In these examples Min() compares date values:
X#
1? TODAY()                    // 05/27/93
2? MIN(TODAY(), TODAY() + 30)        // 05/27/93
See Also