Delphi Error – E2027 Duplicate tag value

Delphi Compiler Error

E2027 Duplicate tag value

Reason for the Error & Solution

This error message is given when a constant appears more than once in the declaration of a variant record.

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

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

begin
end.

Share:

Leave A Reply

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

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...