READVAR()
ReadVar() -> cNameIdentifies the variable of the field being edited.
Overview
The historical manual describes ReadVar in MsGetDados, MsGetDB and MsMGet validation. It returns a variable name, not its value. No result is assumed outside editing context. Avoid turning that name into a macro for arbitrary state access; in MVC use model APIs and event field identifiers. (Sources: refs. 1–1.)
Syntax
ReadVar() -> cNameReturn value
Character: edited variable name.
Commented example
#Include "Protheus.ch"
User Function Ed611()
// Install this block only in a supported GET context.
Local bField := {|| ReadVar()}
ConOut(ValType(bField))
Return NilCreates block B without simulating an active field. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Historical material; verify control and release before attaching validation.
- 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.