User Tools

Site Tools


resetfrombuffer_fill_queue_starting_from_record_buffer_.htm
Navigation:  ABC Library Reference > BrowseClass > BrowseClass Methods >====== ResetFromBuffer (fill queue starting from record buffer) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

ResetFromBuffer, VIRTUAL

blk2blue.jpg

The ResetFromBuffer method fills or refills the browse queue starting from the record in the primary file buffer (and secondary file buffers if applicable). If the record is found, ResetFromBuffer fills the browse queue starting from that record. If the record is not found, ResetFromBuffer fills the browse queue starting from the nearest matching record.

If the active sort order (key) allows duplicates and duplicate matches exist, ResetFromBuffer fills the browse queue starting from the first matching record.

TipBox.jpg

Use ResetFromBuffer when the primary and secondary file positions and values are valid, but the result set may no longer match the buffer values. For example, after a locator or scrollbar thumb move.

Implementation:

ResetFromBuffer succeeds even if there is no exactly matching record and is typically used to locate the appropriate record after a thumb movement.

ResetFromBuffer calls the ViewManager.Reset method for positioning, then calls the ResetQueue method to fill the browse queue.

Example:

IF EVENT() = EVENT:ScrollDrag          !if thumb moved

 IF ?MyList{PROP:VScrollPos} <;= 1      !handle scroll to top

  POST(Event:ScrollTop, ?MyList)

 ELSIF ?MyList{PROP:VScrollPos} = 100  !handle scroll to bottom

  POST(Event:ScrollBottom, ?MyList)

 ELSE                     !handle intermediate scroll

  MyBrowse.Sort.FreeElement = MyBrowse.Sort.Step.GetValue(?MyList{PROP:VScrollPos})

  MyBrowse.ResetFromBuffer             !and reload the queue from that point

 END

END

See Also:     ViewManager.Reset, ResetQueue

resetfrombuffer_fill_queue_starting_from_record_buffer_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1