nRow, nColRow and column where the browse is placed. With PIXEL, coordinates start at the upper-left corner of the parent.
AdvPL Guide@ <nRow>, <nCol> [COLUMN] BROWSE <oBrw> [FIELDS <campos>] [ALIAS <cAlias>] [SIZE <nWidth>, <nHeight>] [OF <oDlg>] [PIXEL]Creates a TCBrowse component for navigating and displaying table or array data.
The @ ... BROWSE command creates a visual navigation grid and stores the resulting object in an AdvPL variable. During compilation, its syntax is translated into the TCBrowse class New() constructor. The component may receive table fields and an alias directly, or be created empty, associated with an array through SetArray(), and populated with columns later.
@ <nRow>, <nCol> [COLUMN] BROWSE <oBrw> [FIELDS <campos>] [ALIAS <cAlias>] [SIZE <nWidth>, <nHeight>] [OF <oDlg>] [PIXEL]nRow, nColRow and column where the browse is placed. With PIXEL, coordinates start at the upper-left corner of the parent.
oBrwVariable that receives the created TCBrowse object.
FIELDS camposTable fields that form the columns. The FIELDS keyword is optional but improves clarity.
ALIAS cAliasAlias of the table used by the component.
FIELDSIZES / SIZES / COLSIZESWidths of automatically created columns, in field order.
HEAD / HEADER / HEADERSTitles of automatically created columns, in field order.
SIZE nWidth, nHeightComponent width and height.
OF oDlgDialog, panel, folder or other visual container that owns the browse. OF is recommended by the official documentation.
SELECT cField FOR uValue1 [TO uValue2]Defines a value or range filter for a field when a table is used.
ON CHANGE / ON DBLCLICK / ON RIGHT CLICKActions run on row change, double-click or right-click.
FONT · CURSOR · COLOR · MESSAGE · PIXEL · WHEN · VALIDCustomize font, cursor, colors, hint, coordinates, focus acceptance and validation.
#Include "TOTVS.ch"
#Include "tcbrowse.ch"
User Function ExBrowseArray()
Local oDlg
Local oBrowse
Local aCustomers := { ;
{"000001", "Alpha Customer", 1500.00}, ;
{"000002", "Beta Customer", 2750.50} ;
}
Define Dialog oDlg Title "Customers" ;
From 180, 180 To 600, 650 Pixel
@ 1, 1 Browse oBrowse Size 220, 156 Of oDlg Pixel
oBrowse:SetArray(aCustomers)
Add Column To oBrowse Array Element 1 Header "Code" Size 60
Add Column To oBrowse Array Element 2 Header "Name" Size 110
Add Column To oBrowse Array Element 3 Header "Amount" Size 70
Activate Dialog oDlg Centered
ReturnSetArray() associates the data and each ADD COLUMN selects the array element to display.
#Include "TOTVS.ch"
#Include "tcbrowse.ch"
User Function ExBrowseTabela()
Local oDlg
Local oBrowse
DbSelectArea("SA1")
SA1->(DbGoTop())
Define Dialog oDlg Title "Cadastro de clientes" ;
From 0, 0 To 300, 600 Pixel
@ 10, 10 Browse oBrowse ;
Fields SA1->A1_COD, SA1->A1_NOME ;
Alias "SA1" ;
Headers "Código", "Nome" ;
ColSizes 60, 180 ;
Size 270, 120 Of oDlg Pixel
Activate Dialog oDlg Centered
ReturnThe alias supplies records while FIELDS, HEADERS and COLSIZES define automatic columns.
© 2026 Usina.BR. Todos os direitos reservados. TOTVS, Protheus, Microsiga e seus respectivos logotipos são marcas de titularidade da TOTVS S.A. AdvPL é uma linguagem de programação desenvolvida pela TOTVS. O AdvPL Guia é um projeto independente, sem vínculo, representação, patrocínio ou afiliação com a TOTVS S.A., suas franquias ou representantes.