cExpressaoExpression containing allowed options.
AdvPL GuidePertence(cExpressao) -> lOkValidates current content against allowed options.
Takes an expression of allowed values and reads the current editing variable/field. Documentation uses MSGET VALID; it is not generic array search. This adaptation uses one character and options 0–4, avoiding undocumented separator semantics for multi-character identifiers. (Sources: refs. 1–1.)
Pertence(cExpressao) -> lOkcExpressaoExpression containing allowed options.
Logical: current content occurs in the expression.
#Include "Protheus.ch"
User Function Ed571()
Local oDlg
Local cValue := "0"
// Validate current content, not an external array.
DEFINE MSDIALOG oDlg TITLE "Example" FROM 0,0 TO 100,300 PIXEL
@ 12,12 MSGET cValue SIZE 40,12 OF oDlg PIXEL VALID Pertence("01234")
ACTIVATE MSDIALOG oDlg CENTERED
Return NilThe field accepts documented options 0–4 during validation; writes no data. 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.