RAD Studio (Common)
ContentsIndex
PreviousUpNext
E2066: Missing operator or semicolon (Delphi)

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.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!