[fpc-pascal] operator in

Michael Van Canneyt michael at freepascal.org
Tue Dec 27 13:47:03 CET 2011



On Tue, 27 Dec 2011, Marcos Douglas wrote:

> Why operator 'in' has a limit?

It is limited to byte-sized types, i.e, max 256 elements.

Michael.

>
> 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
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list