Unit 'DB' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#fcl]

TDataSetEnumerator

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Enumerator for TDataset records.

Declaration

Source position: db.pas line 1988

type TDataSetEnumerator = class

public

  constructor Create();

  

Create a new instance of the dataset enumerator.

  function MoveNext;

  

Attempts to navigate to the next record.

  property Current: TFields; [r]

  

Current record.

end;

Inheritance

TDataSetEnumerator

  

Enumerator for TDataset records.

|

TObject

Description

TDataSetEnumerator is an enumerator for the records in a dataset. It returns the TDataset.Fields instance. It navigates from the first till the last record in the dataset. The following is an example of how this can be used, in conjunction with the field enumerator:

var
  Rec : TFields;
  Fld : TField;

begin
  for Rec in MyDataset do
    for F in Rec do
      Writeln(F.Name,' : ',F.AsString);

Note that the current record pointer of the dataset is modified as the loop is traversed. If the current record is modified by other code while the loop is running, the result may become unpredictable. Similarly, if 2 enumerators are used simultaneously for the same dataset, the results are unpredictable.

See also

TDataset

  

Base class for records-based data-access.

TFields

  

Collection of #fcl.db.TField instances.

TFieldsEnumerator

  

Default enumerator for the fields collection of a dataset.


Documentation generated on: Jul 24 2023