Navigation: ABC Library Reference > BrowseClass > BrowseClass Methods >====== ResetFromBuffer (fill queue starting from record buffer) ====== | |
ResetFromBuffer, VIRTUAL
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.
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