Delphi – E2027 Duplicate tag value

In your Delphi program, When a constant appears more than once in the declaration of a variant record, this error message is displayed.

program Produce;
type
  VariantRecord = record
    case Integer of
    0  (IntField: Integer);
    0  (RealField: Real);     (*<-- Error message here*)
  end;

begin
end.

How to Fix it?

program Solve;
type
  VariantRecord = record
    case Integer of
    0  (IntField: Integer);
    1 (RealField: Real);
  end;

begin
end.
%d bloggers like this: