Board index » delphi » Re: record properties
Alain Quesnel
![]() Delphi Developer |
Re: record properties2003-08-13 12:00:06 PM delphi63 Something like this (code compiles but was not tested): unit Unit2; interface type TMyRecord = record MyInteger: Integer; MyString: string; end; TMyClass = class private FMyRecord : TMyRecord; function GetMyRecord: TMyRecord; procedure SetMyRecord(const Value: TMyRecord); public property RecordA: TMyRecord read GetMyRecord write SetMyRecord; property RecordB: TMyRecord read GetMyRecord write SetMyRecord; property RecordC: TMyRecord read GetMyRecord write SetMyRecord; end; implementation { TMyClass } function TMyClass.GetMyRecord: TMyRecord; begin Result.MyInteger := FMyRecord.MyInteger; Result.MyString := FMyRecord.MyString; end; procedure TMyClass.SetMyRecord(const Value: TMyRecord); begin FMyRecord.MyInteger := Value.MyInteger; FMyRecord.MyString := Value.MyString; end; end. -- Alain Quesnel XXXX@XXXXX.COM www.logiquel.com "Clayton L. Wilson" <XXXX@XXXXX.COM>writes QuoteI have multiple properties in my component. |