Delphi – E2029 %s expected but %s found 

When there are syntax errors in your Delphi program, this error message occurs. There was most likely a typo in the source, or something was missed. When an error occurs at the start of a line, the true error is frequently found on the preceding line.

program Produce;
var
  I: Integer
begin               (*<-- Error message here: ';' expected but 'BEGIN' found*)
end.

The compiler anticipates a semicolon after the type Integer to end the variable definition. It can’t locate the semicolon on the current line, so it continues reading and finds the keyword ‘begin’ at the beginning of the next line. It has finally realised that something is wrong.

program Solve;
var
  I: Integer;       (*Semicolon was missing*)
begin
end.

Only the semicolon was absent in this case, which is a common occurrence in practise. In general, check the line where the error notice occurs, as well as the line above it, to see if anything is missing or misspelt.