Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

DBSkip

DBSkip( [nReg] ) --> Nil

Moves forward or backward through logical record order.

DBSkipAdvPL
01 · OVERVIEW

Overview

DBSkip follows active order, filter and deleted-record settings. Default movement is one; negative counts move backward. Beyond the end, EOF indicates no valid record; do not read fields there. Moving before the start sets BOF. Never substitute magic RecNo numbers for boundary tests because RDD conventions differ. EDTRB identifies only an owned test table already open with the required schema and permissions; examples are not intended for standard tables. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

DBSkip( [nReg] ) --> Nil

Parameters

nReg
NumericOptional

Logical displacement; default 1.

Return value

Nil; not a logical success indicator.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed340()
    If Select("EDTRB") > 0
        If !EDTRB->(Eof())
            EDTRB->(DBSkip(1))
            // Check again after movement.
            ConOut(cValToChar(!EDTRB->(Eof())))
        EndIf
    EndIf
Return Nil
Expected result

Reports a valid record after one forward movement without exposing fields. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check RDD, alias and pending operations. Navigation can flush updates; preserve context under the caller contract and handle errors in the complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. DBSkip. TDN. Accessed on 2026-10-26.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha