Entry-point returns and validation
Matches return type and effect to the actual caller.
Overview
Before choosing Return, inspect how the master consumes it: validation Boolean, button array, replacement text or ignored result. MVC BUTTONBAR uses an array while validation events use Booleans; this is not a universal rule for all entry points. Check transaction timing and repeated event delivery too. The exercise is a synthetic consumer accepting only Booleans, not an entry point or a universal .T. template. (Sources: refs. 1–2.)
Commented example
#Include "Protheus.ch"
User Function Ed626()
Local xResponse := .T.
Local lAccepted := .F.
// Synthetic consumer: this exercise requires a Boolean.
If ValType(xResponse) == "L"
lAccepted := xResponse
EndIf
ConOut(lAccepted)
Return NilProduces .T. for Boolean input. This particular consumer would reject strings and arrays. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Do not trigger irreversible integrations from validation that may run repeatedly.
- 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.