VarEnsureRange

Make sure the variant is within a specified range.

Declaration

Source position: variants.pp line 99

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

Description

VarEnsureRange checks AValue and returns it if it is in the range specified by AMin, AMax. If it is less than AMin, then AMin is returned. If it is larger than AMax, then AMax is returned.

Errors

If the variants are of different types and they cannot be converted, an exception will be raised.

See also

Name Description
VarInRange Check if a variant is in a range of values