Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to get current routine line?

Question
Anna Golitsyna · Dec 14, 2022

How to get current routine line?

I am familiar with $TEXT which can get you any line in the current routine provided you know the offset. For example, $T(+1) will get you the first line of the current routine at the run time. In the same vein, how do I reference the current line number/offset at the run time? Something like $T(+$CURRENTLINENUMBER) where $CURRENTLINENUMBER is not yet known to me function. The sample below would write 3 as the line number.

RTNNAME
 S A=1
W $CURRENTLINENUMBER

#Key Question #ObjectScript #Caché
Product version: Caché 2017.1

Source URL:https://community.intersystems.com/post/how-get-current-routine-line