[fpc-pascal] operator in

Marcos Douglas md at delfire.net
Tue Dec 27 13:41:35 CET 2011


Why operator 'in' has a limit?

procedure TForm1.Button1Click(Sender: TObject);
var
  t,r1,r2: Integer;
begin
  t := 359;
  r1 := 252;
  r2 := 253;
  if r2 in [r1..t-1] then  // 252..359 so, 253 is include
    ShowMessage('Found')
  else
    ShowMessage('Not found');  // <<<<<<< not found
end;

Marcos Douglas



More information about the fpc-pascal mailing list