TList<T>

<< Click to Display Table of Contents >>

Navigation:  Sources >

TList<T>

Any Delphi object with support for IEnumerable or GetEnumerator can be passed to FromList method.

Note that all objects in list should be of the same type.

Query columns can reference public/published object fields, properties and methods. Methods can have parameters. Example:

 
type
  TCustomer = class
  public
    CustomerID: integer;
    Active: boolean;
    Name, Address, City, Country, Email: string;
    function OnSubscription(ADate: TDateTime): boolean;
  end;
 
  TCustList = TObjectList<TCustomer>;
 
  CL := TCustList.Create;
...
 
THtSQL.FromObject(CL, 'select Name, Address, OnSubscription(CURRENT_DATE) from data', []).ToDataset(Dataset1);
 

Nested objects/records can also be referenced. For example 

 

select d.Owner.Caption from data d