Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

@ ... COMBOBOX

@ nRow, nCol COMBOBOX oCbx [VAR nVar] ITEMS aItems [SIZE nWidth, nHeight] OF oWnd

Offers a selection among known options.

@ ... COMBOBOXAdvPL
01 · OVERVIEW

Overview

The eAdvpl reference guide, §3.13, p. 15, records the historical variant shown in the syntax. Fragments assume the matching environment and command definitions; they are not a complete application. The historical variant uses a numeric VAR index and an ITEMS array. TComboBox also documents value binding and F4-related behavior; do not automatically apply that contract to the historical macro. Separate the visible label from the business identifier and validate the index before array access. (Refs. 1–2)

02 · SYNTAX

Syntax

@ nRow, nCol COMBOBOX oCbx [VAR nVar] ITEMS aItems [SIZE nWidth, nHeight] OF oWnd

Parameters

nRow, nCol
NumericRequired

Origin position in the units of the selected variant.

oWnd / oDlg
ObjectRequired

Existing parent window; use the identifier from the actual code.

aItems
ArrayRequired

Displayed options.

nVar
NumericOptional

Selection index in the historical variant; validate before indexing.

Return value

Interface/printing command; do not use as a function-return expression.

03 · PRACTICAL EXAMPLE

Commented example

// Historical fragment; oDlg already exists.
Local oCbx
Local nOption := 1
Local aOptions := {"Open", "Completed"}
@ 2, 2 COMBOBOX oCbx VAR nOption ITEMS aOptions ;
    SIZE 20, 1 OF oDlg
// Read nOption after interaction and validate 1..Len(aOptions).
Expected result

Proposed initial selection: first item. Reading after interaction requires window confirmation, which the fragment does not implement. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Handle an empty list and cancellation. When items reload, revalidate selection before persisting the associated identifier.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Guia de referência eAdvpl. §3.13, p. 15. Cópia pública histórica; autoria e compatibilidade atual não confirmadas. Accessed on 2026-10-24.
  2. TOTVS. Classe TComboBox. TOTVSTEC/TDN. Accessed on 2026-10-24.
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