[fpc-pascal] How to detect an any property change in object?

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Feb 8 13:24:21 CET 2012



On Wed, 8 Feb 2012, Krzysztof wrote:

> Hi,
>
> I have some class with propertys:
>
> type TMyClass = class
>  private
>    FProperty1: Boolean;
>    FProperty2: String;
>    procedure SetProperty2(AValue: String);
>    procedure ClassChanged;
>  public
>    property Property1: Boolean read FProperty1 write FProperty;
>    property Property2: String read FProperty2 write SetProperty2;
>  end;
>
> I want call ClassChanged on each property change. I could create
> SetXXX function for all propertys and there call this method, but
> exists any "low level" hack to detect "write" operation on custom
> property?

Not as part of the language or API. 
You must use setters.

Michael.



More information about the fpc-pascal mailing list