xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DbSkipper()

Helper function for browse objects to skip a database

Syntax

DbSkipper( <nSkipRequest> ) --> nSkipResult

Arguments

<nSkipRequest>
A numeric value indicating the number of records to skip the record pointer.

Return

The return value is the number of records that are actually skipped.

Description

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.

Info

See also:DbSkip(), SKIP, TBrowse()
Category: Object functions , Database functions , xHarbour extensions
Source:rtl\browdbx.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe