FireDAC.Comp.DataSet.TFDDataSet.SetRange

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetRange(const AStartValues, AEndValues: array of const;
AStartExclusive: Boolean = False; AEndExclusive: Boolean = False);

C++

void __fastcall SetRange(const System::TVarRec *AStartValues, const System::NativeInt AStartValues_High, const System::TVarRec *AEndValues, const System::NativeInt AEndValues_High, bool AStartExclusive = false, bool AEndExclusive = false);

Properties

Type Visibility Source Unit Parent
procedure
function
public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

Description

Sets the starting and ending values of a range and applies them.

Use SetRange to specify the beginning and ending range values for the dataset and apply the range. 

AStartValues sets the starting range of the indexed field values. AEndValues sets the ending range of the indexed fields values. SetRange performs the following steps:

  1. Puts the dataset into the dsSetKey state.
  2. Erases any previously specified starting range values and ending range values.
  3. Sets the start and end range values.
  4. Applies the range to the dataset.

If the current dataset record is within a new range, then it becomes current after a call to SetRange. Otherwise, the current position is set to the first record in the range. 

If either AStartValues or AEndValues has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.

Example

FDQuery1.IndexFieldNames := 'CUST_NO';
FDQuery1.SetRange([100], [200]);

See Also