Going back to good old fashioned MUMPs this works for INTs:
CALLS(rtn) ; n NSP,EXT,VER,ROU,LAST,LINE ; NSP = namespace ; EXT = extension/type of routine e.g. INT ; VER = version, default is zero ; ROU = routine name ; LAST = last line or routine i.e. number of lines s ROU=$g(rtn) i ROU="" u 0 w !,"No routine reference supplied" q s NSP="%SYS",EXT="INT",VER=0,LINE="" s ROU=$g(rtn)_"."_EXT_"."_VER ; get last line s LAST=$$LENGTH^%R(ROU,NSP) i LAST>0 d . f i=1:1:LAST d . . s LINE=$$LINE^%R(ROU,i,NSP) . . ; check first character of line against ASCII value . . ; ignore anything below 48 which is zero . . i $a($e(LINE,1))>47 u 0 w !,i,?10,LINE q
Going back to good old fashioned MUMPs this works for INTs:
n NSP,EXT,VER,ROU,LAST,LINE
; NSP = namespace
; EXT = extension/type of routine e.g. INT
; VER = version, default is zero
; ROU = routine name
; LAST = last line or routine i.e. number of lines
s ROU=$g(rtn)
i ROU="" u 0 w !,"No routine reference supplied" q
s NSP="%SYS",EXT="INT",VER=0,LINE=""
s ROU=$g(rtn)_"."_EXT_"."_VER
; get last line
s LAST=$$LENGTH^%R(ROU,NSP)
i LAST>0 d
. f i=1:1:LAST d
. . s LINE=$$LINE^%R(ROU,i,NSP)
. . ; check first character of line against ASCII value
. . ; ignore anything below 48 which is zero
. . i $a($e(LINE,1))>47 u 0 w !,i,?10,LINE
q