Browses, grids and tabular data entry
Separates row presentation, editing and persistence.
Overview
A browse can display array rows or a data context without defining a write policy. The official TCBrowse example associates SetArray with the row collection and bLine with the current row projection through nAt. The fragment assumes a TCBrowse object already constructed in a dialog with two columns and uses fictional data. It enables neither editing nor persistence. For tabular entry, separately define cell validation, row insertion/deletion, cancellation and transaction confirmation; selecting a visual control does not implement those rules. (TOTVS, n.d., ref. 1)
Return value
No single return value: this is a composite workflow.
Commented example
// Fragment: oBrowse is a TCBrowse created with two columns.
// aRows must remain accessible for the control lifetime.
aRows := {{"A", 10}, {"B", 20}}
oBrowse:SetArray(aRows)
oBrowse:bLine := {|| {aRows[oBrowse:nAt][1], aRows[oBrowse:nAt][2]}}Proposes binding two rows to an existing control; not a complete program or a write demonstration. Declare variables in the caller. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Handle empty collections and nAt bounds before projecting rows. Keep display callbacks free of writes; define data ownership and cancellation strategy.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.