xHarbour Reference Documentation > Function Reference |
Helper function for browse objects to skip a database
DbSkipper( <nSkipRequest> ) --> nSkipResult
The return value is the number of records that are actually skipped.
DbSkipper() is a helper function used in the :skipBlock code block of the TBrowse object. It provides for standard skip behaviour when browsing data in a work area.
See also: | DbSkip(), SKIP, TBrowse() |
Category: | Object functions , Database functions , xHarbour extensions |
Source: | rtl\browdbx.prg |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example builds a simple TBrowse object using standard // navigation code blocks. #include "inkey.ch" PROCEDURE Main LOCAL oTBrowse, aFields, cField, nKey USE Customer aFields := Array( FCount() ) AEval( aFields, {|x,i| aFields[i] := FieldName(i) } ) oTBrowse := TBrowseNew() oTBrowse:skipBlock := {|n| DbSkipper(n) } oTBrowse:goTopBlock := {|| DbGoTop() } oTBrowse:goBottomBlock := {|| DbGoBottom() } WITH OBJECT oTBrowse FOR EACH cField IN aFields :addColumn( TBColumnNew( cField, FieldBlock( cField ) ) ) NEXT END nKey := 0 DO WHILE nKey <> K_ESC WITH OBJECT oTBrowse DO WHILE .NOT. :stabilize() ENDDO IF oTBrowse:hitTop Tone(1000) ELSEIF oTBrowse:hitBottom Tone(500) ENDIF nKey := Inkey(0) SWITCH nKey CASE K_UP :up() ; EXIT CASE K_DOWN :down() ; EXIT CASE K_LEFT :left() ; EXIT CASE K_RIGHT :right() ; EXIT CASE K_PGUP :pageUp() ; EXIT CASE K_PGDN :pageDown() ; EXIT CASE K_CTRL_PGUP :goTop() ; EXIT CASE K_CTRL_PGDN :goBottom() ; EXIT CASE K_HOME :home() ; EXIT CASE K_END :end() ; EXIT END END ENDDO CLOSE Customer RETURN
http://www.xHarbour.com