Help w !,"________________________________________________________________________________",!,! w " FIND ROUTINE",! w "________________________________________________________________________________",! w "PARAMETERS:",!,! w "-str :The string to search for",! w "-[Label] :Callback label: jump to this label when a str match is found (str)",! w " Parameters passed trough:-param1: routine name",! w " -param2: routine line",! w " -param3: line code",! w "-[onRtn] :Expression executed when new routine is selected to search (str)",! w "-[onLine] :Expression executed when new routineline is selected to search (str)",!,! w "NOTE:If Label is not present or is empty, the searchresults will be written to",! w "the current device.",!,! w "Values which the user may change/use in Label, onRtn or onLine:",! w "-rtn :current routine name (exmpl. set rtn="" to skip the search in ""rtn""",! w "-i :current routine line",! w "-code :current line code (exmpl. set code="" to skip the search in ""code""",! w "-str :current searchstring",! w "-cbLabel :callback label string",! w "________________________________________________________________________________" Quit ; ss(str,cbLabel,onRtn,onLine) new searchRoutine,i,code,rtn If $G(onRtn)="" Set onRtn="" If $G(onLine)="" Set onLine="" If $G(cbLabel)="" Set cbLabel="cbWrite^srFind" set searchRoutine="" for set searchRoutine=$o(^$Routine(searchRoutine)) quit:searchRoutine="" do . set rtn=searchRoutine . X onRtn . Quit:rtn="" . set code="",i=1 . for set code=$Text(+i^@rtn) quit:code="" do .. X onLine .. Quit:code="" .. set i=i+1 .. if code[str do ... X "Do "_cbLabel_"(rtn,i,code)" Quit ; cbWrite(Routine,Label,Code) new spaces set spaces="" set $P(spaces," ",38-$L(Routine))="" w $E(Routine,1,36),spaces,$J($E(Label,1,4),4)," ",$TR($J($E(Code,1,35),35)," ",""),! Quit ;