Question Anna Golitsyna · Aug 22, 2024

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

Comments

Julius Kavay · Aug 22, 2024

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

0
Anna Golitsyna  Aug 26, 2024 to Julius Kavay

$STACK, of course. It looks like current line is represented by $st(1,"MCODE"). Did not know about $zname. Thanks!

0