Question Anna Golitsyna · Aug 28

Studio's Find In Files finds nothing if CLS routines are included. The error is WIDE CHAR. After using ##class(%Studio.Project).FindInFiles programmatically and then ZW after the same error I strongly suspect that CodeWalkopdatecopyopt in EnsLib.InteropTools.HL7.Cloverleaf.Parser.cls  is to blame. I cannot even open this class, unlike other classes from EnsLib.InteropTools.HL7. This error prevents searching even if System Items are excluded and I would peg EnsLib as System. Any remedy besides updating IRIS? Assuming this is fixed in later IRIS versions.

0
0 0
Question Anna Golitsyna · Aug 7

For example, you start debugging the AAA function, which calls the BBB function, then goes to the CCC^ABC function in a different routine and ends up while executing XXX^XYZ. No other routines or functions are visited in this example. What I would like is to get the record of AAA -> BBB -> CCC^ABC -> XXX^XYZ. No marking each function with recording code should be involved: too time consuming, too many functions in real code.

UPD: Iris has built in %SYS.Trace for this purpose but this class is apparently absent in Cache 2017. Did not find any substitutes yet.

0
0 0
Question Anna Golitsyna · Jul 9

I like Application Error Log a lot, both for its full stack and a big list of variables. I'd like to "hack" this functionality and record the same in this log when a certain variable has a certain value. This quasi error should not be visible to the user, and it should not interrupt the application flow. Is that possible?

Throwing an error in a try-catch block does not record the error, tested. I am considering recording variables and the stack differently, I know how to do both, but that would miss the nice Application Error Log functionality.

0
0 0
Question Anna Golitsyna · Jun 6

Let's suppose two different routines use one and the same chunk of code. From the object-oriented POV, a good decision is to have this chunk of code in a separate class and have both routines call it. However, whenever you call code outside of the routine as opposed to calling code in the same routine, some execution speed is lost. For reports churning through millions of transactions this lost speed might be noticeable. Any advice how to optimize specifically speed?P.S. Whenever someone is talking about the best choice for whatever, I am always tempted to ask: "What are we optimizing?".

0
0 0
Question Anna Golitsyna · Jun 2
    I like the Application Error Log functionality a lot. However, it becomes time consuming to inspect it date by date and directory by directory on a multidirectory server. Ideally, I would use an existing error class to write a custom error report by date, selected namespaces, etc. Does such a system class actually exist? Not that I found. The detail level on the screenshot below is enough.  
    Some Application Error Logs go back a couple of years and load for a long while. Is there any programmatic way to clean them? Deleting errors in GUI date by date and directory by directory is rather
0
0 0
Discussion Anna Golitsyna · Apr 10

I ask ChatGPT periodically to produce ObjectScript or plain MUMPS code for string manipulation, or for implementing known algorithms etc. Occasionally, it does make mistakes or uses non-existing class members but generally not that bad. Is there any tutorial on the subject of using AI for coding, ideally specifically for ObjectScript/MUMPS? Any AI productivity advice, or tricks you are using, or another AI flavor?

Thanks in advance,
Anna

0
0 0
Question Anna Golitsyna · Feb 4

The task is to find all globals that are referenced in certain routines. I could search for ^ using class(%Studio.Project).FindInFiles  but that would also find ^ in comments and function calls. I can distinguish between a global and a function call visually, but it would be lovely to be able to skip function calls programmatically. Is it possible?

The Find and Replace screen in Studio has a capability of searching for ^ with Match Element Type set to Global Variable. Maybe I could use that but what is the ObjectScript function behind this screen if any?

0
0 0
Question Anna Golitsyna · Aug 22, 2024

Is there a general way to set a variable XYZ equal to the text of the code line being executed now? Debugger or production. For example, for a code below if code is currently assigning a to 1, XYZ would be equal "S a=1". The same question about a variable containing current routine name.

S a=1

0
0 0
Question Anna Golitsyna · Jul 24, 2024

As I was trying to create a routine search query via RoutineList, I discovered that documentation both for Cache and Iris offers only ABC* and ABC? syntax for including routine names and, unlike %RO, does not offer name ranges. Is that indeed so?

After some system files reading, I discovered that you can EXCLUDE certain routines with ', by using the 'ABC or 'ABC* syntax. That is not documented but it should be. Any other non-documented RoutineList syntax capabilities? 

Example:

0
0 0
Question Anna Golitsyna · Jul 16, 2024

I have a few routines in ^rINDEX that are missing in ^ROUTINE. At least some of those routines lack a timestamp, probably Date and Time Modified in ^rINDEX. It causes D %RO crash when such a routine is referenced by a routine range, since "" is an illegal $ZDTH value.

Healthy entry (note the timestamp): ^rINDEX("ABC,"INT")    =    $lb("2021-06-15 15:08:38.846885",)   ;The second argument is sometimes present and sometimes not, likely the routine size.

Unhealthy entry (note an empty timestamp): ^rINDEX("DEF,"INT")    =    $lb("",21) 

0
0 0
Question Anna Golitsyna · May 2, 2024

I am trying to locate a method that would allow me to differentiate between InterSystems preinstalled/system namespaces and "our own" namespaces. I am interested both in Cache and Iris answers if they are different. Yes, I can list what to disregard, like if not HSLIB or if not DOCBOOK but hoping for a more universal and elegant answer.

0
0 208
Question Anna Golitsyna · Mar 5, 2024

The task for a file on disk is to open it, find a keyword (unique) and then read the file line by line, starting with the line with this keyword, then find the next keyword (also unique) and read from that location etc. I would think ObjectScript classes should be able to do that, but the solution eludes me. I probably need to use FindAt to get a position, but ReadLine does not seem to have a position argument. Any advice?

0
0 306
Question Anna Golitsyna · Feb 27, 2024

The goal is to identify programmatically all SOURCE namespaces on a server to which the routines are mapped. In the example below from the Namespaces page in Management Portal the answer would be USER. But some other namespaces on the same server could be mapped to a different namespace or even mapped to itself.

0
0 263
Question Anna Golitsyna · Jan 19, 2024

I am inspecting our DB globals in order to reduce sizes of the worst offenders if possible. When I come to a large global, I am interested which of its nodes are the largest. Hence code below with unexpected different results. Any explanations why are results different?

6
0 437
Question Anna Golitsyna · Sep 13, 2023

I have an odd binary result exporting a specific routine via Studio, Export. Below is the beginning. The seemingly same routine in a different directory is exported fine, regular human readable code. Inspecting ^ROUTINE and ^rIndex did not give me any clues. Any insights?

3
0 254
Question Anna Golitsyna · Apr 13, 2023

Is there any ObjectScript or a basic function that takes a string and separates it into words + punctuation/spaces array/list? Just not to reinvent the wheel. Say, process "It is a test, after all" into "It", space, "is", space, "a", space, "test", ", ", "after", space, "all". Or something to that effect.

9
0 384
Question Anna Golitsyna · Feb 9, 2023

Let's supposed somebody updates routines via %RCOPY or %RI, the really old-style hardcore way which still works. Does that leave any log traces in Journaling or system globals, as of when exactly did it happen or what was the IP address of the machine changes came from? I am aware only of the Date Modified changes as seen when opening the file.

4
0 395
Question Anna Golitsyna · Dec 14, 2022

I am familiar with $TEXT which can get you any line in the current routine provided you know the offset. For example, $T(+1) will get you the first line of the current routine at the run time. In the same vein, how do I reference the current line number/offset at the run time? Something like $T(+$CURRENTLINENUMBER) where $CURRENTLINENUMBER is not yet known to me function. The sample below would write 3 as the line number.

RTNNAME
 S A=1
W $CURRENTLINENUMBER

13
1 616
Question Anna Golitsyna · Oct 13, 2021

Is there an ObjectScript analog of Find with Match Element Type option? I know there is an  ObjectScript analog of Find in Files, Studio.Project.FindInFiles and Studio.Project.FindInProject, but I failed to locate so far an analog of Edit/Find. I am specifically interested in Match Element Type option so I could search across selected files for globals. Somehow Studio.Project.FindInFiles does not offer this option natively.

3
0 453
Question Anna Golitsyna · Oct 8, 2021

I am trying to figure out the best ObjectScript analog to mimic, more or less, the %RCOPY functionality. What would be ObjectScript  method(s) if any to copy a routine from the current namespace to another one and compile it there?

12
0 364
Question Anna Golitsyna · Aug 6, 2021

My objective is to find routine's Date/Time Saved someplace inside Cache. The routine's Date/Time Modified as returned by various queries like %Library.RoutineIndex and as seen on the File Open screen is actually Date/Time Compiled last, not Date/Time Saved last. Does anyone know if Date/Time Saved is created when the Save icon is pressed or the routine is imported? Such a timestamp should be immune to subsequent compilations with no changes.

5
0 589
Question Anna Golitsyna · May 12, 2021

There is an undocumented command, $preprocess, that can be called as below. In this case it takes the class name and converts its code into a text array. That includes comments as well. Two questions about it if you know:

  1. Is that the only job that $preprocess does?
  2. Why would it generally work for most classes except for a single class? This is probably a bug since it works in a later Cache option for this class too but I need to work with this Cache version as well. This class does not contain any control characters except for plain vanilla tabs, checked.
8
0 275
Question Anna Golitsyna · Feb 5, 2021

Hi everybody,

Is there any functionality I could use that triggers real time user-defined code on certain audit events? Right now I am interested in triggering such code on a routine modification event, like the one below. I do know how to access this record programmatically, via %SYS.Audit.

Thanks in advance,
Anna

8
0 389
Question Anna Golitsyna · Jan 19, 2021

I have multiple projects that I utilize when debugging in Cache Studio. One of my projects suddenly lost the ability to step through commands with the yellow box and the cursor moving though code lines. The cursor just sits at the entry line while variables apparently do change. Interestingly enough, if I change the project and the debug target, the "yellow box" ability is still there. Apparently losing this functionality is by project/debug target/whatever. The goal is, of course to return it back but how?P.S. Maybe it is some odd Cache Studio registry corruption or some Cache system global

24
0 817
Question Anna Golitsyna · Jan 8, 2021

Hi,

The question is about queries on the System->SQL page. I have a class with a few columns on a global and the test output looks as expected, below. This works as expected as well returning a single row: select * from Utils.RoutineAuditReport where counter=4. However, other columns give an odd error like " Field 'AG' not found in the applicable tables^ SELECT * FROM Utils . RoutineAuditReport WHERE UserR = "AG". As you can see below, both the UserR column and the AG entry in it do exist. What could be the problem?

Thanks in advance,
Anna

2
0 233
Question Anna Golitsyna · Nov 11, 2020

Hi everybody,

Is there a way to run code on another machine? Of course, all authentication info is known. I know only about RemoteResultSet but that seems to be query specific.

Thanks in advance,
Anna
P.S. The ultimate goal, in case that matters, is to create identical globals on 2 different machines with one run.

22
1 679
Question Anna Golitsyna · Sep 11, 2020

I come from Visual Studio and now I use mostly Cache 2017 Studio. One debugging functionality I miss dearly is current local variables automatically appearing in the Watch Variables window together with their values. Yes, I can hover or type them myself but both actions take extra time which is especially noticeable when debugging unfamiliar code across many routines. Any Cache settings or plugins to that effect? If not then why not? And if nothing else is there in Cache, what are the alternatives or hacks in this respect?

Anna

12
0 423