Sign in Join
FPDoc Onlineexperiment

TCustomBufDataset.GetRecord function

Member of TCustomBufDatasetprotectedIn unit BufDataset

Gets the record buffer for the record at the specified relative position.

Declaration

pascal
function GetRecord(Buffer: TRecordBuffer; GetMode: TGetMode; 
 DoCheck: Boolean): TGetResult; override

Arguments

Buffer

Record buffer for the values from the dataset.

GetMode

Relative position for the request.

DoCheck

Indicates if an exception should be raised for error conditions.

Function result

Result for the operation.

Description

GetRecord is an overridden TGetResult function used to get the record buffer for the record at the position specified in GetMode. GetRecord implements the abstract method defined in the ancestor class.

Buffer is the record buffer used to store the values for the requested record.

GetMode indicates the relative position for the requested record, and can contain one of the values from the TGetMode enumeration.

DoCheck indicates if an Exception should be raised when the return value is grError.

The return value is a TGetResult value that indicates the result for the action performed in the method. The return value is grOK when the record buffer contains values for the record at the requested position.

GetRecord uses the index storage in CurrentIndexBuf to determine if a record is available at the relative position requested in GetMode. When GetMode contains gmPrior or gmNext, methods in CurrentIndexDef are called to scroll to the desired record and set the return value for the method. The GetCurrent method in CurrentIndexBuf is called when GetMode contains gmCurrent.

When the return value is grOK, the CurrentRecordToBuffer method is called to copy record values into the record buffer.

When the dataset is Filtered, the values in Buffer are assigned to the FilterBuffer for the dataset. The dataset changes its State to dsFilter and calls the DoFilterRecord method to determine if the record meets the Filter condition. If the record does not meet the filter condition, the return value is set to grError. If the return value is not grError, the action is repeated until a record matching the filter condition is found.

The return value is grError when no matching record is located in the dataset.

GetRecord is used in the implementation of the GetNextRecord, GetPriorRecord, and Resync methods in TDataset.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.