$zu(96,9) Not working
Suppose you have routine ^A loaded in your partition in programmer mode and you call routine ^B. Routine ^B finds the value of $ZU(96,9) which should be the calling routine.
But $ZU(96,9) now returns null, as does $SYSTEM.Process.CallingRoutine()
Works on 2018.1.7 but not 2018.1.8
$ROLES= %All on both systems
More precisely I have line label ZZPP in ^%ZLANGC00 which needs to identify the original routine in the partition and do some work on it. When I type ZZPP I get nothing on the later version. Here's the line of code:
ZZPP New RTN Set RTN=$ZU(96,9) QUIT:RTN="" WRITE !,$T(+1^@RTN)
If I add a line label zzpp to my calling routine that reads "zzpp ZZPP QUIT" and then "DO zzpp" while the routine is loaded, it works.
ZL A ZZPP ; should work but doesn't
Comments
It appears to only work intermittently from "D zzpp".
If I ZLOAD another routine then go back and ZLOAD the first one, then it doesn't work.
But if I issue an argumentless ZSAVE followed by "d zzpp" it works again.
From Replacements for ObjectScript $ZUTIL Functions
| $ZUTIL Function | Description | Class | Property / Method |
|---|---|---|---|
|
96, 9 |
Returns the calling routine name. |
That has the same problem
I found a work around for it. Not perfect but it will do
S RTN=$ZU(96,9) // or $SYSTEM.Process.CallingRoutine() which is identical in this situation
I RTN="" F I=$ZU(41):-1:1 S RTN=$P($ZU(41,I),"^",3) I RTN'=$T(+0) Q:RTN'=""