Found something strange in Delphi again which I've been trying to fix for days until I discovered it's probably a Delphi issue :-P

Found something strange in Delphi again which I've been trying to fix for days until I discovered it's probably a Delphi issue :-P

Crate a new TDatamodule in your application, set its OldCreateOrder to false if you haven't done so already. Create a new datamodule which inherits from he one you just made and saved. You'll notice it's OldCreateOrder is false since it inherits it from it's ancestor.

Save both Units, close them, reopen them and check the OldCreateOrder on both. On the ancestor it will still be false, on the descendant it will be reset to true (and added in the DFM). Whatever you do ... on the descendant it keeps resetting to True.

Thought it was something wrong in my code, until I discovered the default Datamodule does the same thing :-P

Comments

  1. I looked in to it years ago and from memory... it is because of the method that is used after the "Stored" setting on the property. When false, it doesn't get saved, however the default it true. So when it gets read in, there is no value, so it defaults. You set it to false, and when it gets written out, it doesn't save it, so when you read it again.... :-\

    I will mention again, it was years ago when I looked in to it (and since then, I have lost my mind... if found, please return it to me, preferably caged).

    ReplyDelete

Post a Comment