System.Variants.VarEnsureRange

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function VarEnsureRange(const AValue, AMin, AMax: Variant): Variant;

C++

extern DELPHI_PACKAGE System::Variant __fastcall VarEnsureRange(const System::Variant &AValue, const System::Variant &AMin, const System::Variant &AMax);

Properties

Type Visibility Source Unit Parent
function public
System.Variants.pas
System.Variants.hpp
System.Variants System.Variants

Description

Returns a Variant with a value in a specified range.

VarEnsureRange returns a Variant whose value is guaranteed to be within a specified range.

AValue is a Variant with the value you want as long as it is in range. If AValue is in range, VarEnsureRange returns AValue.

AMin is a Variant with the minimum acceptable value. If AValue is less than AMin, VarEnsureRange returns AMin.

AMax is a Variant with the maximum acceptable value. If AValue is greater than AMax, VarEnsureRange returns AMax.

See Also