Sign in Join

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

Mailing lists / lazarus / 2010-02

Defining a default value for a string property

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Luiz Americo Pereira Camara

I have an component that needs to have a default value for a published string property.

Currently, the property value is initialized in the constructor:

MyProperty := 'MyDefaultValue';

The value of the property is stored in the *.lfm file.

Things work fine until i try to set MyProperty to an empty string through the OI.

The MyProperty value ('') is not stored in the lfm and when the project is reloaded MyProperty resets to the 'MyDefaultValue'.

Is there a way to always store a property in lfm even for ''?

Is there a better approach to handle default values for published string properties?

Luiz

Reply by email