RAD Studio
ContentsIndex
PreviousUpNext
Applying or Canceling a Range

When you call SetRangeStart or EditRangeStart to specify the start of a range, or SetRangeEnd or EditRangeEnd to specify the end of a range, the dataset enters the dsSetKey state. It stays in that state until you apply or cancel the range.

When you specify a range, the boundary conditions you define are not put into effect until you apply the range. To make a range take effect, call the ApplyRange method. ApplyRange immediately restricts a user's view of and access to data in the specified subset of the dataset.

The CancelRange method ends application of a range and restores access to the full dataset. Even though canceling a range restores access to all records in the dataset, the boundary conditions for that range are still available so that you can reapply the range at a later time. Range boundaries are preserved until you provide new range boundaries or modify the existing boundaries. For example, the following code is valid:

.
.
.
MyTable.CancelRange;
.
.
.
{later on, use the same range again. No need to call SetRangeStart, etc.}
MyTable.ApplyRange;
.
.
.

 

.
.
.
MyTable->CancelRange();
.
.
.
// later on, use the same range again. No need to call SetRangeStart, etc.
MyTable->ApplyRange();
.
.
.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!