Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

X1Def02

X1Def02()

Reads definition 2 of a combo question in the current language.

X1Def02AdvPL
01 · OVERVIEW

Overview

The historical manual describes reading definition 2 of a combo question from the already positioned SX1 record in the current language. It is not the selected answer: the definition identifies option 2 of the positioned combo question. The caller must confirm the key beforehand: an open alias and valid record do not prove intended identity. Community samples use fixed keys without checking DbSeek; this adaptation does not repeat that lookup. An aliased expression avoids changing the active area and does not modify the dictionary. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

X1Def02()

Return value

Character per historical manual.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed715()
    Local xResult := Nil
    // The caller already verified this record key; do not reposition here.
    If Select("SX1") > 0
        If !SX1->(Eof())
            xResult := SX1->(X1Def02())
        EndIf
    EndIf
    // Display only the type, without exposing dictionary content.
    ConOut(ValType(xResult))
Return Nil
Expected result

Displays the result type; absent alias or EOF leaves Nil and displays U. Content/language are not fixed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Historical contract: verify availability/positioning on the target release. Do not open, close or edit SXs as a lookup side effect.
  • 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. 381–382. Referência histórica. Accessed on 2026-10-28.
  2. Universo do Desenvolvedor. eurairapelli/universo_do_desenvolvedor_site. ADVPL/Funcoes/Arquivos SXs/X1Def02.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