Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-09

detecting and accessing a properties 'stored' value via RTTI

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I need to find out if I need to store a property value or note. The property is published and has the 'stored' directive / storage specifier.

I know how to test if the property value is equal to the propertie's default value. But how to I determine the default value if the storage specifier 'stored' is used?

eg:

  TMyObject = class(TPersistent)
  published
     property Prop1: boolean read FProp1 write FProp1 default True;
     property SomeProp: booleand
                read GetSomeProp
                write SetSomeProp
                stored IsSomePropStored;
  end;

I know how to handle 'Prop1', but don't know how to determine the default value or result of IsSomePropStored for the 'SomeProp' property.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 5 lines
Hi, I need to find out if I need to store a property value or note. The property is published and has the 'stored' directive / storage specifier.

I think I found the solution. TypInfo.IsStoredProp() seems to do what I need.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/