Anna Golitsyna · Dec 15, 2022 go to post

Not quite what I was looking for but very interesting in its own right. Thanks, Alexey!

Anna Golitsyna · Dec 14, 2022 go to post

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.

Anna Golitsyna · Oct 14, 2021 go to post

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.

Anna Golitsyna · Oct 11, 2021 go to post

Also %RCOPY preserves date modified of the original routine, and I'd rather preserve it. So far other listed approaches do not preserve it.

Anna Golitsyna · Oct 11, 2021 go to post

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.

Anna Golitsyna · Oct 11, 2021 go to post

Robert, it does not trigger source control and yes, I'd like it non-interactive too.

Anna Golitsyna · Oct 8, 2021 go to post

Marc, a slight variation on your idea, tested whether targetRtn exists or not. Thanks again!

zn "A"
currRtn=(##class(%Routine).%OpenId(rtnName))
stream=currRtn.Read()
zn "B"
targetRtn=(##class(%Routine).%OpenId(rtnName))
sc=targetRtn.Write(stream)
targetRtn.Save()

Anna Golitsyna · Oct 8, 2021 go to post

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.

Anna Golitsyna · Sep 21, 2021 go to post

One more question if I may: I try to exclude global subnodes but so far unsuccessfully. Is it possible?
This correctly exports the corresponding node only:  items("SOMEGLOBAL(""ABC"",""XYZ"",""USERFORM_ATEST"").GBL") = ""
Now if I try to exclude this node from the SOMEGLOBAL like this,  items("SOMEGLOBAL.GBL",'"SOMEGLOBAL(""ABC"",""XYZ"",""USERFORM_ATEST"").GBL") = "", it does not exclude it. There is a barely visible single negating quote in the beginning of the second item.

Anna Golitsyna · Aug 6, 2021 go to post

Robert, thanks a lot! This is what I saw today too in these nodes but not something I saw a few days ago. So I am still perplexed to some extent. I'll try various scenarios later, probably next week and will get back here if anything would be different.

Anna Golitsyna · Jul 21, 2021 go to post

You are right about GSIZE. The other, slower functionality I had in mind is below:
set statement=##class(%SQL.Statement).%New()
set status=statement.%PrepareClassQuery("%SYS.GlobalQuery","Size")

Anna Golitsyna · Jul 19, 2021 go to post

Very interesting. If reading ObjectScript is ancient what can one say about pure, unadulterated MUMPS smiley ? That was rhetorical, of course. I wonder how speed would fare with Python. GSIZE is way faster than the analogous ObjectScript functionality, at least for Cache 2017 that I use.

Anna Golitsyna · Jun 11, 2021 go to post

I hit largely the same $System.OBJ.%Save <ZSG> error, in a code you cannot see, of course. After reading this thread I realized that the only unusual thing I did is to give my programmatically created project a numeric name. Apparently, there is a check inside %Save: if numeric it must be an object ID and not name… The error was gone as soon as I added a letter in the beginning of the name.

I am also on Cache 2017
 

Anna Golitsyna · May 13, 2021 go to post

If a specific class member causes this, yes, that might work indeed. I need to try it.

Anna Golitsyna · May 13, 2021 go to post

That was one of the first ideas that I checked before posting here. Yes, it is large comparing to most other package classes but two much larger classes from the same package have been imported alright.

Anna Golitsyna · May 12, 2021 go to post

Dmitry, thanks for the advice. The first function is not available in this Cache version and it will actually export, not just convert code to an array. The Atelier one calls the $preprocess command in question inside its stack and Atelier is not available in this Cache version either. The last function would be perfect but it also calls the $preprocess command in question and this is exactly where the call for this specific class dies, inside $preprocess.

Anna Golitsyna · Apr 1, 2021 go to post

One late addition: I just lost this debugging functionality again, looks like because my code was going into a different namespace via zn "nsp". If I put the first breakpoint AFTER this zn, the cursor does not go to it and the yellow box does not appear. However, if I put my first breakpoint AT zn, the yellow box appears at it and stays with me after the breakpoint as well. Can't say it's a feature but then what?? smiley

Anna Golitsyna · Feb 9, 2021 go to post

Losing debugging capabilities, Scenario #2.
A fellow programmer also lost her debugging capabilities some time ago though for different reasons and with different symptoms. I am not dead sure what happened in her case but it looks like some unfortunate combination of User Roles and Service Settings as defined in Management Portal. We discussed it today and she tried a few things. Changing the studio login user helped as well as changing localhost in Cache Server Manager to an actual IP address. Using Remote System Access from the cube was beneficial as well.

Anna Golitsyna · Feb 9, 2021 go to post

Alright, this particular saga suddenly came to the end revealing the bug, my own one. But it is sort of educational so some details. I am implementing source control like features on and off while inheriting one of the features from a previous programmer. The latter feature which I preserved was about adding a timestamp with the compilation time to the changed routine in the overwritten source control method, OnAfterCompile. OnAfterCompile was adding this timestamp, resaving the routine  directly in one of the internal routine globals, and it did NOT recompile the file again. That effectively still had the file internally marked as saved and compiled, no little cross in the Studio's routine tab, BUT that threw the .OBJ file mapping to the routine source code enough so the debug yellow box would refuse to appear and the cursor would not move from the first line. Many self eye-rolling emojis here...
How did I discover it? I need to modify this custom source control class and it was annoying to do so while the source control was on so I turned it off, moved functionality to my test routine, and observed with incredulity the long lost yellow debug box again....
P.S. On the plus side, I learned a lot about inner Cache workings due to this largely self-inflicted wound and I am happy it is over.

Anna Golitsyna · Feb 8, 2021 go to post

Robert, that's what I initially thought too and it's indeed mostly so but not 100%: the old style %RI is actually calling the new style ROUTINE^%R, with Audit classes and all. Just no source control class suspenders smiley . I see no technical reason not to have them in ^%R but they are not there. The ZSAVE implementation is not available.
So this is why I am trying to tackle this problem from the Audit side. Any ideas? I am thinking of a process monitoring the audit trail records but I don't quite like this solution. In any event, is there anything beyond monitoring?

Anna Golitsyna · Feb 8, 2021 go to post

I don't want to close access but to run custom code when the same routines are modified via a terminal. Cache, and looks like Iris, do not trigger source control hooks when terminal is used, say, for ^%RI. Yes, I can close terminal access via the same Roles, but I'd rather not to do that if other solutions exist.

Anna Golitsyna · Feb 8, 2021 go to post

I already have custom source control hooks related to this issue but unless IRIS to which you link changed something in this respect source control hooks are bypassed when terminal is used for uploading routines. The cursory glance at the link hints that nothing has changed.