Skip to main content

Prior

procedure Prior;

Example

procedure MoveBack(const Data: TvxClientDataSet);
begin
if not Data.BOF then
Data.Prior;
end;

Usage

Attempts to move one record backward and updates BOF when no prior record is available.

  • Use only with a bidirectional dataset.
  • Check BOF before reading after backward navigation.
  • Avoid calling repeatedly after BOF because the before-scroll callback still runs.

Usage guidance

  • Use only with a bidirectional dataset.
  • Check BOF before reading after backward navigation.
  • Avoid calling repeatedly after BOF because the before-scroll callback still runs.
  • Explicitly Post/Cancel first if automatic edit resolution is unwanted.
  • Reverse loops must still make progress or terminate.

Additional Technical Info

Prior is declared by hidden ancestor TDataSet and is normally used through a visible descendant such as TvxClientDataSet. It delegates to MoveBy(-1) and requires a bidirectional dataset when reading prior records.

Source-backed behaviour

The inherited movement resolves pending edits through browse mode, invokes scroll events, walks buffered/descendant records and sets BOF when the beginning is reached. GetPriorRecord calls CheckBiDirectional, so unidirectional datasets raise when backward retrieval is needed.

If already at BOF, the relative move performs no backward work, but it still resolves browse mode and invokes DoBeforeScroll without the directional branch's matching DoAfterScroll. The method has no return value; inspect BOF or call MoveBy directly when actual movement matters.

Next moves forward. BOF is the backward boundary flag.

Official RTL references

Created 2026-07-15