if a and b then ....
var arr: array[1..2] of Integer; k := 2; while (i <= k) and (arr[i] > 0) do begin i := i + 1; end;