Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

@ ... LISTBOX

@ nRow, nCol LISTBOX oLbx [VAR nVar] ITEMS aItems [SIZE nWidth, nHeight] OF oWnd

Displays selectable list items.

@ ... LISTBOXAdvPL
01 · OVERVIEW

Overview

The eAdvpl reference guide, §3.12, 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 command binds ITEMS to a numeric VAR selection. TListBox provides direct construction and methods such as SetArray; consult the method signature before replacing component data. A selected position does not establish a business identifier and must not be retained blindly after reordering. (Refs. 1–2)

02 · SYNTAX

Syntax

@ nRow, nCol LISTBOX oLbx [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 oLbx
Local nItem := 1
Local aItems := {"Documentation", "Examples", "Tests"}
@ 2, 2 LISTBOX oLbx VAR nItem ITEMS aItems SIZE 28, 5 OF oDlg
// Validate nItem before reading aItems[nItem].
Expected result

Proposes three items initially selecting the first. No data is written. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Handle cancellation and empty lists; after reloading, restore a valid selection or signal that none exists.
  • 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.12, p. 15. Cópia pública histórica; autoria e compatibilidade atual não confirmadas. Accessed on 2026-10-24.
  2. TOTVS. Classe TListBox. 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