function inArray(x: integer; mas: array of integer): boolean;
var i, n: integer;
begin
i := 0;
n := length(mas) + 1;
setLength(mas, n);
mas[n - 1] := x;
while not mas = x do
i:= i + 1;
if i = n - 1 then
Result := true
else
Result := false;
end;
В выделенной строке компилятор говорит, что "incompatible types". Не пойму в чем проблема?