xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DbSkip()

Moves the record pointer in a work area.

Syntax

DbSkip( [<nRecords>] ) --> NIL

Arguments

<nRecords>
Numbers of records to move the record pointer. Positive values for <nRecords> move the record pointer forwards (towards the end of file), negative values move it backwards. The default value is 1, i.e. calling DbSkip() with no parameter advances the record pointer to the next record.

Return

The return value is always NIL.

Description

This function moves the record pointer by the number of <nRecords> records in the current work area, unless prefixed with an alias. Record pointer movement is relative to the current record and follows the logical order active in a work area. That is, indexes, filters and scopes define the order in which records are navigated.

The record pointer cannot be moved beyond the begin or end of file. An attempt to do so causes either Bof() or Eof() be set to .T. (true), and the record pointer remains unchanged.

Note:  DbSkip(0) flushes and refreshes the internal database buffers. All changes made to the record become visible without moving the record pointer in either direction.

Info

See also:Bof(), DbGoBottom(), DbGoto(), DbGoTop(), DbSeek(), Eof(), GO, OrdSkipRaw(), SKIP
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows a typical coding pattern for scanning a database
// in a DO WHILE loop based on a condition. DbSkip() is always called
// at the end of the loop, when the condition must be tested for the
// next record.

   PROCEDURE Main()
      USE Customer ALIAS Cust NEW

      DO WHILE .NOT. EoF()
         ? Cust->Firstname,Cust->Lastname
         DbSkip()
      ENDDO

      USE
   RETURN

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