Question
Evgeny Shvarov · Dec 4, 2020

Macro to know all the parameters transferred to the method

Hi folks!

Often while debugging you want to know the values of all the parameters.

Using VSCode Debugger is not an option.

What do you use to know what parameters came to the method?

My hope if you have a "magic" macro that will store all the variables with their names into a global?

And share your approaches, please?

20
2 0 6 130
Log in or sign up to continue

Replies

Instead of inserting debug_macros, try Intersystems TRACE utility.

write $$DIR^TRACE("c:\Temp") ; to set an output directory
write $$ON^TRACE(jobnr) ; the pid of the process you want to trace
; zn "appNamespace"
; do ^yourProgram
; zn "%SYS"
write $$OFF^TRACE(jobnr) ; to stopp the trace
do ^TRACE ; to display the trace result

TRACE displays the function-/method-calls with arguments.

Cool! Never knew we have such a utility. 

Thanks!

Is it documented anywhere? I can't find it in on-line doc.

Yes, in the ^TRACE routine itself. From command line (in %SYS namespace) issue a "do ^TRACE" and you will get a nice documentation... ;-)

Thanks Robert and Julius... just wonder if not being documented means that it's not a supported or recommended feature.