Go Up to Error and Warning Messages (Delphi)
The property to which you are attempting to assign a value did not specify a 'write' clause, thereby causing it to be a read-only property.
program Produce;
type
Base = class
sย : String;
property Titleย : String read s;
end;
var
cย : Base;
procedure DiddleTitle
begin
if c.Title = then
c.Titleย := 'Super Galactic Invaders with Turbo Gungla Sticks';
(*perform other work on the c.Title*)
end;
begin
end.
If a property does not specify a 'write' clause, it effectively becomes a read-only property; it is not possible to assign a value to a property which is read-only, thus the compiler outputs an error on the assignment to 'c.Title'.
program Solve;
type
Base = class
sย : String;
property Titleย : String read s;
end;
var
cย : Base;
procedure DiddleTitle
var titleย : String;
begin
titleย := c.Title;
if Title = then
Titleย := 'Super Galactic Invaders with Turbo Gungla Sticks';
(*perform other work on title*)
end;
begin
end.
One solution, if you have source code, is to provide a write clause for the read-only property - of course, this could dramatically alter the semantics of the base class and should not be taken lightly. Another alternative would be to introduce an intermediate variable which would contain the value of the read-only property - it is this second alternative which is shown in the code above.