Usina BRAdvPL Guide
Sign in
← All topics
PRACTICAL GUIDEUnder review

Debugging and variable inspection

Prepares a small case for inspecting values at a breakpoint.

Debugging and variable inspectionAdvPL
01 · OVERVIEW

Overview

Official TDS VSCode documentation covers launch.json setup, server connection and F5 startup. Debug Console can inspect variables and execute operations: evaluating an expression is not necessarily side-effect-free observation. Compile the source in the matching test environment and place a breakpoint on the nTotal line, inspecting nQuantity and nPrice before assignment and nTotal after stepping. The example uses fictional data and opens no tables. Versions and launcher configuration must match the selected SmartClient. (TOTVS, n.d., ref. 1)

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"
User Function Ed345()
    Local nQuantity := 2
    Local nPrice := 15
    Local nTotal
    // Breakpoint on this assignment; step to inspect the result.
    nTotal := nQuantity * nPrice
    ConOut(cValToChar(nTotal))
Return Nil
Expected result

After assignment, expected nTotal is 30; before it the local has no assigned numeric value. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Match source and RPO. Do not evaluate write functions merely to inspect; avoid exposing credentials or real data in captures and logs.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. TDS VSCode, wiki oficial, Configurações de Debug e Debug Console. GitHub. Accessed on 2026-10-26.
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