RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Variants.VarEnsureRange Function

Returns a System::Variant with a value in a specified range.

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

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

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

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

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

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!