Unit 'Variants' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

VarEnsureRange

Make sure the variant is within a specified range.

Declaration

Source position: variants.pp line 106

function VarEnsureRange(

  const AValue: Variant;

  const AMin: Variant;

  const AMax: Variant

):Variant;

Arguments

AValue

  

Value to check.

AMin

  

Lower bound of range.

AMax

  

Upper bound of range.

Function result

Value limited within specified range.

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

VarInRange

  

Check if a variant is in a range of values.


Documentation generated on: Dec 13 2024