RAD Studio Athens

E2168

Go Up to Error and Warning Messages (Delphi)

You have specified an identifier for a read or write clause to a property which is not a field or method.


program Produce;

  var
    rย : string;

  type
    Base = class
      tย : string;
      property Titleย : string read Title write Title;
      property Captionย : string read r write r;

    end;

begin
end.

The two properties in this code both cause errors. The first causes an error because it is not possible to specify the property itself as the read & write methods. The second causes an error because 'r' is not a member of the Base class.


program Solve;

  type
    Base = class
      tย : string;
      property Titleย : string read t write t;
    end;

begin
end.

To solve this error, make sure that all read & write clauses for properties specify a valid field or method identifier that is a member of the class which owns the property.