Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

READVAR()

ReadVar() -> cName

Identifies the variable of the field being edited.

READVAR()AdvPL
01 · OVERVIEW

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.)

02 · SYNTAX

Syntax

ReadVar() -> cName

Return value

Character: edited variable name.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed611()
    // Install this block only in a supported GET context.
    Local bField := {|| ReadVar()}
    ConOut(ValType(bField))
Return Nil
Expected result

Creates 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.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. AdvPL — O Manual. Referência histórica, p. 368. Contrato atual não homologado. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha