Delphi Error – E2066 Missing operator or semicolon

Delphi Compiler Error

E2066 Missing operator or semicolon

Reason for the Error & Solution

This error message appears if there is no operator between two subexpressions, or no semicolon between two statements.

Often, a semicolon is missing on the previous line.

program Produce;
var
  I: Integer;
begin
  I := 1 2                 (*<-- Error message here*)
  if I = 3 then            (*<-- Error message here*)
  Writeln('Fine')
end.

The first statement in the example has two errors – a ‘+’ operator and a semicolon are missing. The first error is reported on this statement, the second on the following line.

program Solve;
var
  I: Integer;
begin
  I := 1 + 2;              (*We were missing a '+' operator and a semicolon*)
  if I = 3 then
  Writeln('Fine')
end.

The solution is to make sure the necessary operators and semicolons are there.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...