I\'m curious to know why Delphi treats record type properties as read only:
TRec = record
A : integer;
B : string;
end;
TForm1 = class(TForm)
This is because property are actually complied as a function. Properties only return or set a value. It is not a reference or a pointer to the record
so :
Testing.TestRecord.I := 10; // error
is same as calling a function like this:
Testing.getTestRecord().I := 10; //error (i think)
what you can do is:
r := Testing.TestRecord; // read
r.I := 10;
Testing.TestRecord := r; //write
It is a bit messy but inherent in this type of architecture.