Go Up to Error and Warning Messages (Delphi)
The default property which you have specified for the class is not an array property. Default properties are required to be array properties.
program Produce;
type
Base = class
function GetVย : Char;
procedure SetV(xย : Char);
property Dataย : Char read GetV write SetV; default;
end;
function Base.GetVย : Char;
begin GetVย := 'A';
end;
procedure Base.SetV(xย : Char);
begin
end;
begin
end.
When specifying a default property, you must make sure that it conforms to the array property syntax. The 'Data' property in the above code specifies a 'Char' type rather than an array.
program Solve;
type
Base = class
function GetV(iย : Integer)ย : Char;
procedure SetV(iย : Integer; const xย : Char);
property Data[iย : Integer]ย : Char read GetV write SetV; default;
end;
function Base.GetV(iย : Integer)ย : Char;
begin GetVย := 'A';
end;
procedure Base.SetV(iย : Integer; const xย : Char);
begin
end;
begin
end.
By changing the specification of the offending property to an array, or by removing the 'default' directive, you can remove this error.