bCondBlock returning a logical value for each record.
AdvPL GuideDBSetFilter( bCond, cCond ) --> NilDefines a visibility condition for the work area.
DBSetFilter accepts equivalent logical block and text expressions. It does not immediately reposition: DBGoTop navigates under the filter. DBGoTo can physically reach records outside it, so a filter is not authorization enforcement. The demonstration requires character ED_COD on the owned table and leaves filter/position changed; a complete routine must manage that state. 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)
DBSetFilter( bCond, cCond ) --> NilbCondBlock returning a logical value for each record.
cCondExpression equivalent to the block.
Nil; not a logical success indicator.
#Include "Protheus.ch"
User Function Ed337()
// ED_COD must be a character field in the owned table.
If Select("EDTRB") > 0
EDTRB->(DBSetFilter({|| ED_COD == "A"}, "ED_COD == 'A'"))
EDTRB->(DBGoTop())
ConOut(cValToChar(!EDTRB->(Eof())))
EndIf
Return NilReports whether a record with the fictional code is visible; data-dependent. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.