Access to current line text
Is there a general way to set a variable XYZ equal to the text of the code line being executed now? Debugger or production. For example, for a code below if code is currently assigning a to 1, XYZ would be equal "S a=1". The same question about a variable containing current routine name.
S a=1
Product version: Caché 2017.1
Discussion (0)0
Comments
in a routine or class, the line
ClassMethod ALine()
{
quit$st($st,"MCODE")
}gives you the line quit $st($st,"MCODE")
The systemvariable $zname gives you the name of the routine, where you reference $zname and in a classmethod $this gives you the name of the class
$STACK, of course. It looks like current line is represented by $st(1,"MCODE"). Did not know about $zname. Thanks!