EPUB | CHM | PDF

TMySQLDirectQuery.Methods.MoveBy

Top Previous Next

Positions the cursor on a record relative to the active record in the dataset.

Syntax:

function MoveBy(aDistance : int64) : int64;

Description:

Call MoveBy to position the cursor on a record relative to the active record in the dataset. aDistance indicates the number of records to move. A positive value for aDistance indicates forward progress through the dataset, while a negative value indicates backward progress.

For example, the following statement moves backward through the dataset by 10 records:

MoveBy(-10);

Function returns the actual number of records moved. In most cases, Result is the absolute value of aDistance, but if MoveBy encounters the beginning-of-file or end-of-file before moving aDistance records, Result will be less than the absolute value of aDistance.

See also: RecNo, RecordCount properties, First, Last, Next, Prior methods