Delphi – E2066 Missing operator or semicolon

Delphi Error

E2066 Missing operator or semicolon

Problem

If there is no operator between two subexpressions or no semicolon between two statements, this error message displays.

On the previous line, a semicolon is frequently absent.

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

A ‘+’ operator and a semicolon are missing from the first statement in the example. The first error is reported on this line, and the second is recorded on the next 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.

You can fix this problem by ensuring that all of the required operators and semicolons are present.

%d bloggers like this: