How to do it...

For the DataSetClassHelpers.dproj project, let's start to talk about the simpler helper—the SaveToCSV method.

The current compiler implementation of class helpers allows only one helper active at a time. So, if you need to add two or more helpers at the same time, you have to merge all the methods and properties in a single helper class. Your TDataSet helper is contained in the DataSetHelpersU.pas unit, and is defined as follows:

TDataSetHelper = class helper for TDataSet  public    procedure SaveToCSVFile(AFileName: string);    function GetEnumerator: TDataSetEnumerator;  end;

To use this helper with your TDataSet instances, you have to add the DataSetHelpersU unit in the uses clause of the unit where you want to use the helper. ...

Get Delphi Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.