Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

X3Uso

X3Uso(cUsed,[nModule]) -> lUsed

Checks field usage availability in a module.

X3UsoAdvPL
01 · OVERVIEW

Overview

The manual has X3Uso accept X3_USADO content plus optional module number, defaulting to the current module. Its Boolean return is not user authorization. Do not pass the field name instead of content. This adaptation receives content through a block rather than copying the unchecked lookup from the community sample. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

X3Uso(cUsed,[nModule]) -> lUsed

Parameters

cUsed
CharacterRequired

X3_USADO content.

nModule
NumericOptional

Module; current by default.

Return value

Logical in the historical reference.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed727()
    // X3_USADO content; current module when omitted.
    Local bUsed := {|cUsed| X3Uso(cUsed)}
    ConOut(ValType(bUsed))
Return Nil
Expected result

Creates block B without deciding usage for a specific field. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Verify module/representation in the release. Do not replace access controls with this check.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Waterloo Ferreira da Silva. AdvPL — O Manual, p. 387. Referência histórica. Accessed on 2026-10-28.
  2. Universo do Desenvolvedor. eurairapelli/universo_do_desenvolvedor_site. ADVPL/Funcoes/Arquivos SXs/X3Uso.PRW. Arquivo completo analisado; adaptação. Accessed on 2026-10-28.
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