RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.SetRange Method

Sets the starting and ending values of a range, and applies it.

Pascal
procedure SetRange(const StartValues: array of const; const EndValues: array of const);
C++
__fastcall SetRange(const array of const StartValues, const array of const EndValues);

Call SetRange to specify a range and apply it to the dataset. The new range replaces the currently specified range, if any. 

StartValues indicates the field values that designate the first record in the range. In C++, StartValues_Size is the index of the last value in the StartValues array.  

EndValues indicates the field values that designate the last record in the range. In C++, EndValues_Size is the index of the last value in the EndValues array. 

SetRange combines the functionality of SetRangeStart, SetRangeEnd, and ApplyRange in a single procedure call. SetRange performs the following functions: 

1Puts the dataset into dsSetKey state. 

2Erases any previously specified starting range values and ending range values. 

3Sets the start and end range values. 

4Applies the range to the dataset. 

After a call to SetRange, the cursor is left on the first record in the range. 

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

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!