Question Anna Golitsyna · Mar 5 How to read from file starting from a certain position? 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? #Caché 0 6 0 118
Question Anna Golitsyna · Feb 27 How to find Routine Mappings programmatically? 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. #Caché 0 6 0 106
Question Anna Golitsyna · Jan 19 Global Size: Comparing different methods 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? #Globals #Caché 0 6 0 153
Question Anna Golitsyna · Oct 4, 2023 Is it possible to have a MUMPS variable representing all subscripts for a global? Is it possible to have a single MUMPS variable representing all subscripts for a global? For example, if I have an ^ABC global and the ^ABC(1,2) node exist, is it possible to have a variable TEMP so that ^ABC(TEMP) would represent ^ABC(1,2)? TEMP="1,2" obviously does not work since it is interpreted as a single subscript, not two subscripts. #Caché 0 4 0 252
Question Anna Golitsyna · Sep 13, 2023 Cache: Binary export output 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? #Caché 0 4 0 173
Question Anna Golitsyna · Apr 13, 2023 Breaking a string into words 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. #ObjectScript #Caché 2 9 0 323
Question Anna Golitsyna · Feb 9, 2023 Tracking %RCOPY and %RI 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. #Caché 0 4 0 330
Question Anna Golitsyna · Dec 14, 2022 How to get current routine line? 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=1W $CURRENTLINENUMBER #Key Question #ObjectScript #Caché 1 13 1 394
Question Anna Golitsyna · Oct 13, 2021 ObjectScript analog of Find with Match Element Type 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. #Caché 0 3 0 371
Question Anna Golitsyna · Oct 8, 2021 Object script analog of RCOPY 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? #ObjectScript #Caché 0 12 0 275
Question Anna Golitsyna · Aug 6, 2021 Cache routines: Date and Time Saved vs. Date and Time Modified 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. #Caché 0 5 0 375
Question Anna Golitsyna · May 12, 2021 $preprocess failure 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: #Caché 0 8 0 220
Question Anna Golitsyna · Feb 5, 2021 Need on Audit event functionality 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 #Security #Caché 1 8 0 263
Question Anna Golitsyna · Jan 19, 2021 Debugging: Lost/Missing debugging functionality 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? #Debugging #Caché 0 24 0 544
Question Anna Golitsyna · Jan 8, 2021 SQL: How to make WHERE work? 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 #SQL #Caché 0 2 0 179
Question Anna Golitsyna · Dec 11, 2020 %Net.SMTP and Gmail I am trying to send email via smtp.gmail.com. #Caché 0 3 0 566
Question Anna Golitsyna · Nov 11, 2020 Running code on another machine 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. #Access control #Namespace #Caché 0 22 1 513
Question Anna Golitsyna · Sep 11, 2020 Automatic Watch variables 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 #Debugging #Caché 0 12 0 309
Question Anna Golitsyna · Sep 1, 2020 Importing globals limitations and errors Hi, I exported selected globals from a Cache 2017 database into a single 4 Gb gof file. Now I tried to import from this file via Management Portal on a different machine . Only about half of the globals was imported and my attempts to select additional globals led to nothing, no new globals have been imported. Well, obviously I am mildly curious what's going on and how can I see the corresponding error which did not appear in the Import window but I can also shrug it off and consider what should I do next. #Data Import and Export #Caché 0 23 0 854
Question Anna Golitsyna · Aug 19, 2020 Class properties from class name Hi, I'd like to compare classes in two namespaces, whether the corresponding .cls code exist in both namespaces or not, and if it does exist in both namespaces, whether the CLS code is identical. If there is such a routine out there the better, I'd like to see it. If not, I know how to get a list of classes in each namespace and I can check currClss.TimeChanged. What I cannot find is the following: #Databases #Caché 0 8 0 402