Skip to content

VarInRange

Check if a variant is in a range of values.

Declaration

Source position: variants.pp line 105

function VarInRange(const AValue: Variant; const AMin: Variant; 
                   const AMax: Variant) : Boolean;

Arguments

Name Description
AValue Value to check.
AMin Lower bound of range.
AMax Upper bound of range.

Function result

True if AValue is in range [AMin..AMax].

Description

VarInRange is an auxiliary function which checks whether AValue is in the range defined by AMin and AMax, borders included.

Errors

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

See also

Name Description
VarEnsureRange Make sure the variant is within a specified range.