Difference between revisions of "InRange"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function InRange(const Value, Min, Max: Integer): Boolean; </source> ===Source=== <source lang="scar"> function InRange(const V...")
 
(No difference)

Latest revision as of 09:05, 28 June 2011

Definition

function InRange(const Value, Min, Max: Integer): Boolean;

Source

function InRange(const Value, Min, Max: Integer): Boolean;
begin
  Result := (Value >= Min) and (Value <= Max);
end;

Availability

SCAR Divi 3.00 > Current

Description

Returns true if a given integer value Value is larger than or equals a given value Min and is smaller than or equals a given value Max.

Example

begin
  WriteLn(InRange(5, 1, 10));
  WriteLn(InRange(0, 1, 10));
end.

Output:

1
0

See Also