lCondLogical condition.
AdvPL GuideIIF(lCond,uTrue,uFalse) -> uResultSelects a value within a conditional expression.
The first argument is logical; the next two are results for true and false. Return type depends on the selected branch. This example uses text without external effects. For command sequences and failure handling, IF/ELSE is clearer than long nested expressions. (Sources: refs. 1–1.)
IIF(lCond,uTrue,uFalse) -> uResultlCondLogical condition.
uTrueValue for true.
uFalseValue for false.
Selected branch value; its type depends on that value.
#Include "Protheus.ch"
User Function Ed484()
Local lReady := .T.
// Selection between values of the same type.
Local cState := IIF(lReady,"Ready","Pending")
ConOut(cState)
Return NilDisplays Ready. 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.