0

I am using TFIBDataset component with Delphi 2010.

Whenever I just open a form on which I have kept TFIBDataset component(s) and close the same form without doing any changes, and if try to compare that .dfm file with same file in code repository, I always find the below code for all the "TFIBStringField" field in all the respective TFIBDataset component(s)

Transliterate = False

I would like to avoid this code coming in .dfm file. How do I stop this, so code comparison becomes easier ?

With Best Regards.

Vishal

Vishal Tiwari
  • 739
  • 2
  • 12
  • 28

1 Answers1

1

I guess, you've updated FIBPlus since last time you opened the form in form designer?

Such behaviour occurs when component properties are added but not given a default value. Default values are not saved in dfm-files.

I suggest you check those differences not to change your applications behaviour and then commit them to your repository. You won't be bothered with this property in the future. Though, it could happen for other properties as well.


UPDATE: I just recovered your question. I took a look into source code and now have a theory, why value of Transliterate is reset:

Default value of Transliterate is True (see Data.DB.pas). Therefore, value True won't be saved in dfm file. In constructor of TFIBStringField (see below) Transliterate is set to False.

constructor TFIBStringField.Create(AOwner: TComponent);
begin
   inherited;
   FDefaultValueEmptyString:=False;
   Transliterate:=False;
end;

As the value True is not saved in dfm, it won't be set, when the content of dfm is assigned to the instance of TFIBStringField.

René Hoffmann
  • 2,766
  • 2
  • 20
  • 43
  • Whenever I am loading "TFIBStringField" fields in the Fields Editor, that time if I see the "Transliterate" property of such field, I see as Transliterate is False i.e. it is supposed to be True which is its default property. It is displaying as "False" means somewhere "False" is set. How do I remove and make it to True, so whenever I load such fields then default value would be True. – Vishal Tiwari Apr 28 '15 at 05:25
  • Even if I am making all "TFIBStringField" fields's Transliterate property to True and saving. After closing and opening the form, again all the "TFIBStringField" field's Transliterate property value becomes False. – Vishal Tiwari Apr 28 '15 at 05:36
  • I recovered your question and added another explanation. – René Hoffmann Jul 14 '15 at 09:57
  • @ René Hoffmann: Thanks a lot. What is happening is one team is using old version of FIB Plus component in that source code this create constructor is not setting value to False where as in new source code of FIB Plus component it is set exclusively. That's why when one team save their source code they come across this issue. – Vishal Tiwari Jul 17 '15 at 07:14