Excellent, just excellent. It did find correctly all globals in a routine (no indirection). I populated in = ##class(%Stream.TmpCharacter).%New() with this code:
S NumLines=^ROUTINE(routineName,0,0)
F n=0:1:NumLines {
S line=$T(@routineName+n^@routineName)
D in.Write(line),in.Write($c(13,10))
}
D in.Rewind()
I also added this after your Write:
Set line=$G(^ROUTINE(rtnName,0,lineNum+1))
Write $C(9),$E(line,token.p+1,token.p+token.c),!
I did not try finding globals in classes, but I assume this would be very similar. Is there any online documentation that shows that token value for globals is 18? Would be curious about other token values.
- Log in to post comments