Delphi: Warnigs → Errors

Want to force your dev team to address Compiler Warnings rather than ignoring them?

Elevate Warnings to Errors:

1) Go to Project Options
2) Under Delphi Compiler, select Hints and Warnings
3) Expand the Output warnings item
4) For each important Warning you wish for your developers to address rather than ignore, select the drop-down list and select Error.


Thanks Simon Stuart for hint!


Mixing datasets

One user asked me:

I have master-detail application using PostgresDAC. But I want to set for each TPSQLDataset descendant it’s own TPSQLDatabase. Is it possible?

The answer was:

Have no idea why do you need this, but we’ve checked this functionality and we are confirming that this can be done.

Why am I writing about this? Because curiosity is in the blood. 🙂 My next step was to mix TMySQLDataset descendant from MySQLDAC as master and PostgresDAC’s object as slave. Holy molly! It works. Then I tried another TDataset descendants from BDE, ADO, FIBPlus etc.

They can be mixed any way you want. Yeah, baby! True perversion. 🙂

How to get rid of published property in Delphi

note This article available in Russian.


Developing PostgresDAC I faced such problem twice. And both times changes affected TPSQLDump component as most developing class.


Change TPSQLDump.TableName: string property to TPSQLDump.TableNames: TStrings.


Code speaks for itself:

    TPSQLDump = class(TComponent)
        procedure ReadTableName(Reader: TReader);
        procedure DefineProperties(Filer: TFiler); override;
        //property TableName: string ...
        property TableNames: TStrings read FTableNames
                                   write SetTableNames;
    end; //TPSQLDump



procedure TPSQLDump.DefineProperties(Filer: TFiler);
  Filer.DefineProperty('TableName', ReadTableName, nil, False);

procedure TPSQLDump.ReadTableName(Reader: TReader);
var S: string;
  S := Reader.ReadString;
  if S > '' then FTableNames.Append(S);


We defined TableName property as if it still exists and assigned ReadTableName function to read its value. Since we didn’t assigned a function for writing (we pass nil as second parameter) this property will never be stored in the future. Problem solved.


Thanks to Alexey Vukolov aka vuk for the idea.