Debugging and variable inspection
Prepares a small case for inspecting values at a breakpoint.
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)
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 NilAfter 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.
- 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.

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