Sign in Join
FPDoc Onlineexperiment

EnsureRange function

In unit Math

Change value so it fits in a specified range.

Declaration

pascal
function EnsureRange(const AValue: Integer; const AMin: Integer; 
 const AMax: Integer): Integer; overload

Description

EnsureRange returns Value if AValue is in the range AMin.. AMax. It returns AMin if the value is less than AMin, or AMax if the value is larger than AMax.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.