Member variable TBrowse():skipBlock Foundation

Contains a code block used to skip through the data source.

Attribute: EXPORTED
Data type: Code block | NIL
Description

This instance variable contains a code block which is used by the methods :stabilize() and :forceStable() to move the record pointer of the data source, generally in response to user input that results in the browse cursor moving up and down. Two arguments are passed to the code block: the first is a numeric value which represents the number of skip operations and the direction in which the record pointer should be moved within the data source. A positive value indicates that the movement should be toward the end of the data source. A negative value indicates that the movement should be toward the beginning of the data source. The second argument passed to the code block is a reference to the TBrowse object itself. The code block must return the number of records it actually skipped. If the number returned is different from the number requested, this indicates that either the end of the file or begininng of file was reached. If skipping forward, the end of file was reached and the TBrowse object sets the variable:hitBottom to .T. (true). If skipping backward, the beginning of file was reached and the TBrowse object sets the variable :hitTop to .T. (true).

By default, a newly instantiated TBrowse object has no movement capability, because its :skipBlock instance variable contains the value NIL. Typically, when using a TBrowse object to browse data in an Xbase++ work area, :skipBlock should be set to {|n| DBSkipper(n) }. DbSkipper() is a function included with Xbase++ that assumes the data is work area based and moves the record pointer accordingly. In this case when a user moves the browse cursor up or down, the function DBSkipper() will be called and passed the number of rows the TBrowse object is requesting it to skip. It then performs the data movement, and returns the number of records actually skipped.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.