CorMath: Clamp

Clamp

Returns value clamped to the inclusive range of Min and Max.



 Public Function Clamp(
	  ByRef Value As Variant,
	  ByRef Min As Variant,
	  ByRef Max As Variant ) As Variant

Parameters

Value
[ByRef] Variant. The value to be clamped.
Min
[ByRef] Variant. The lower bound of the result.
Max
[ByRef] Variant. The upper bound of the result.

Return Values

Variant -  Returns Value if between Min and Max.
-or-
Min if Value is less than.
-or-
Max if Value is greater than.

See Also

Project CorLib Overview

Class CorMath Overview