Thanks a lot, Alex!
Not quite what I was looking for but very interesting in its own right. Thanks, Alexey!
Hi Cristiano, This might do for my ultimate purposes, thanks, but strictly speaking $STACK does not return the line number which in this case is 7 (Teste+2). It returns line number relative to the enclosing function only. So I'll wait in case there is a different solution as well.
I added a picture of what I am looking for to the post (Edit/Find). I think FindInFilesRegex corresponds more or less to Use wildcards on this screen.
Also %RCOPY preserves date modified of the original routine, and I'd rather preserve it. So far other listed approaches do not preserve it.
Yes, that works and assigns the time of copy as the date modified. Thanks, Stephen! BTW, in my experience at least some old-fashioned commands are faster than their modern equivalents though in this case the speed is not an issue.
Robert, it does not trigger source control and yes, I'd like it non-interactive too.
Marc, a slight variation on your idea, tested whether targetRtn exists or not. Thanks again!
zn "A"s currRtn=(##class(%Routine).%OpenId(rtnName))s stream=currRtn.Read()zn "B"s targetRtn=(##class(%Routine).%OpenId(rtnName))s sc=targetRtn.Write(stream)d targetRtn.Save()
Thanks! Let's see if there are less "clunky" ways
That would make the routine from namespace A immediately available in namespace B as is. The goal is to have routines in two namespaces different until the time comes for the programmer to make them the same via an RCOPY analog. It is also a "per routine" job used for synchronizing.
Log in or create a new account to continue