NEGATIVO()
NEGATIVO() -> lOkValidates a negative current-field value.
Overview
This function does not take the value as an argument: it depends on the current editing variable or field. Documentation uses it in MSGET VALID. An isolated call with a number or string therefore does not represent its contract. The source calls POSITIVO/NEGATIVO inverses but does not clarify zero; test that boundary and use explicit comparison when rules require > 0 or < 0. (Sources: refs. 1–1.)
Syntax
NEGATIVO() -> lOkReturn value
Logical result for current content in the validation context.
Commented example
#Include "Protheus.ch"
User Function Ed556()
Local oDlg
Local nValue := -1
// Validation depends on the field being edited.
DEFINE MSDIALOG oDlg TITLE "Example" FROM 0,0 TO 100,300 PIXEL
@ 12,12 MSGET nValue SIZE 100,12 OF oDlg PIXEL VALID NEGATIVO()
ACTIVATE MSDIALOG oDlg CENTERED
Return NilOpens a dialog and evaluates content during field validation; writes no data. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Run only in a UI session. Distinguish population, sign and business rules; test empty/cancellation cases too.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.