Can a record be used as a property of an object?
问题 I'd like to make a record as an object's property. The problem is that when I change one of the fields of this record, the object isn't aware of the change. type TMyRecord = record SomeField: Integer; end; TMyObject = class(TObject) private FSomeRecord: TMyRecord; procedure SetSomeRecord(const Value: TMyRecord); public property SomeRecord: TMyRecord read FSomeRecord write SetSomeRecord; end; And then if I do... MyObject.SomeRecord.SomeField:= 5; ...will not work. So how do I make the property