type TTest = class FField : Integer; readonly; end;
A field marked as readonly can only be assigned at declaration or in a constructor of the class.
Note that “readonly” is a contextual keyword, you can still have fields named “ReadOnly” if you want to, so there should be no compatibility issues with existing code. If several fields are declared together, the readonly qualifier will apply to all of them:
FImReadOnly, FImReadOnlyToo : Integer; readonly; FAndMeAsWall : Integer := 123; readonly;