So, what is (x, y-0) etc. meant to evaluate to? That's not a Boolean expression nor an integer that could be processed with a bit manipulation.   Ok, assuming this somehow is a Boolean anyway, that's the code I'd use:   Res := True; For i := 0 to 7 do begin   If not (x, y-i) then begin     Res := False;     Break;   End; End; if Res then   ....