Show: Delphi C++
Display Preferences

E2029 %s expected but %s found (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Error and Warning Messages (Delphi)

This error message appears for syntax errors. There is probably a typo in the source, or something was left out. When the error occurs at the beginning of a line, the actual error is often on the previous line.

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

After the type Integer, the compiler expects to find a semicolon to terminate the variable declaration. It does not find the semicolon on the current line, so it reads on and finds the 'begin' keyword at the start of the next line. At this point it finally knows something is wrong...

program Solve;
  I: Integer;       (*Semicolon was missing*)

In this case, just the semicolon was missing - a frequent case in practice. In general, have a close look at the line where the error message appears, and the line above it to find out whether something is missing or misspelled.

Personal tools
In other languages
Previous Versions