On the back of my recent post on writing bug-less code I wanted to raise a few suggestions (to ISC) that would help prevent certain types of bugs at compile time. I've probably missed a few, but these are the main ones in my mind. Please contribute more suggestions.
Btw, these also serve as potential gotchas for new COS developers.
I have classes A and B, B derived from A, A has method Abc.
From INT of class B I see that compiler copies implementation of Abc to class B, so that Abc exists both in A and B.
As result, when B invokes Abs, B.Abs() is executed instead of A.Abs(). In result debuger is not able to step into Abs and breakpoints in A.Abs never hit.
Why this happens and how can I avoid this?
Update:
OK, now I know the reason: compiler makes the copy if Abc has this line:
I'm looking at adding multilingual support to a couple of open source projects I'm working on. The solutions are already developed in CSP so I am not looking for alternative approaches.
I'm wondering what would be the best approach for CSP and separate JavaScript files.
Initially I was wondering if I should bake the default system language text at compile time, or provide the end user with a language selection option at run time.
Class Queries in InterSystems IRIS (and Cache, Ensemble, HealthShare) is a useful tool that separates SQL queries from Object Script code. Basically, it works like this: suppose that you want to use the same SQL query with different arguments in several different places.In this case you can avoid code duplication by declaring the query body as a class query and then calling this query by name. This approach is also convenient for custom queries, in which the task of obtaining the next row is defined by a developer. Sounds interesting? Then read on!
I'm developing a mini-framework to implement annotations in Cache. I want to support two kind of annotations: metadata and method decorators. I've got stuck trying to implement the second one.
Metadata
With metadata annotations I can add metadata to any kind of target. A target can be a method/classmethod, parameter, property and class.
Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process.
So another topic that has been of interest to a number of people since the beta was put up last week is in regard to Studio Hooks and Atelier. This requires a bit of background and then some discussion of how the architecture of Atelier necessitates some changes and then what our current thinking on the subject is.
Since version 1.93 of VS Code, the “import and compile” process has been very slow (more than an hour). Have you encountered this issue and do you know how to resolve it?
1.1 I met a few project that their interface servers were crashed. Cutoms wanted resume server as fast as we can. their servers are running at lan,and they can't use git,there are some namesapce in the server running different service,and usualy there is only one server.
1.2 In the message,it has property in typeof characterstream,as you know,the message search page doesn't support filtering with property of characterstream,so it's so hard to find the messge you want.
I am currently doing an internship and learning about InterSystems IRIS and ObjectScript and have downloaded and installed the community version of IRIS.
I have not made any changes in the Management Portal. In Visual Studio Code I have loaded the InterSystems ObjectScript Extension Pack.
If I now want to compile a file, VSC throws an error: "ERROR #16006: Document name 'x.csp' is invalid"
Due to a new project I'm getting involved inside %Installer stuff deeper than ever I'd be happy to. Most of it was pretty easy to get, thanks to documentation, articles and SAMPLES example, while I can't dig good solution for one problem.
How to understand what's wrong with compilation if the compilator just hides errors?
Compilation started on 05/15/2023 15:58:11 with qualifiers 'cuk'
Detected 1 errors during compilation in 0.003s.
Compilation started on 05/15/2023 15:58:32 with qualifiers 'cuk'
Detected 1 errors during compilation in 0.002s.
Compilation started on 05/15/2023 15:58:51 with qualifiers 'cuk'
Detected 40 errors during compilation in 0.089s.
40 errors, and what do I have to do with this so valuable information?
I am currently trying to add a condition to a routing rule that uses the %Source property of a routing rule. Unfortunately I am getting compile errors when I use the "%", and if I get PROPERTY DOES NOT EXIST if I try and use any of field. I have tried referencing the messages as "Message." , "Record.", "FullRecordMapClassName." , "Document." . Does anyone know how to reference the properties of a record map in a routing rule, or if it is even possible? Thanks!
Can someone give me an example of how to JOB a class method that requires an array of values to be passed to it by reference.
This is what I tried, but am getting compile errors because of the .params
job ##class(%SYSTEM.OBJ.FM2Class).All(.params)::5
Any thoughts on how to accomplish this, the simplest way. I would like to avoid writing all of this to some global and having to write some wrapper to pick it up and then call the class method, which I certainly could do. but is this the only way to do it?
*** updated from a comment as original question may not have been clear**
To clarify my question this is the library property helper class Library property helper when you look at the documentation for computed from documentation here Computed documentation
I'm experiencing an issue while compiling code in Visual Studio Code with "cuk" qualifiers.
When I try to compile, the following message appears after a while:
In VSC, the "cuk" qualifiers are always used as default and the following message is shown in the Output panel of VSC when a compilation is successful:
I was wondering if there is any way to trigger the compilation of a class based on the compilation of another (unrelated) class. For example:
Class 1 = test.class
Class 2 = test.class.type.one
Class 3 = test.class.type.two
Every time class 2 or class 3 is compiled in Studio I would like to have class 1 automatically compiled as well.
The reason I need this is because class 1 has a method with CodeMode set to objectgenerator which generates some code based on what is found in classes 2 and 3.
I am using &html<> to output some CSS to my page (which is a class-based and not a tag-based page), and the selectors contain the '>' character which the compiler chokes on. How can I escape the '>' so it still displays as such in the web page source but doesn't trip up the compiler?
I'm trying to learn M programing for an Epic db class prerequisite. They said to download the IRIS Studio software to do the testing. I'm having a very difficult time finding information the language. I'm trying to run some examples that Epic has provided (like in below) but the compiler complains that it isn't valid. Of course, it doesn't tell you why it isn't valid.
We are in the process of migrating from Ensemble to IRIS.
After the migration I would like to find all usages of deprecated classes and methods in all of our code. This is to align with the changes in package like %SYSTEM.SQL for example.
Is there an easy way to do this, or maybe a tool that can assist?
I am trying to import the SalesForce Enterprise WSDL in InterSystems Ensemble Studio using the SOAP Add-In. However, when I do so I receive a class dependency loop, Error #5316 during compilation. The WSDL is the standard WSDL provided with SalesForce and works fine in SoapUI. In the SalesForce WSDL it is allowed for an object A to include an object B as an element, while at the same time object B is allowed object A as an element. I think this is what causes the class dependency loop for InterSystems. Does anyone has any suggestion how I can circumvent this error?
Is CR/LF changes to DTL files edited/committed to git via VS Code a known issue?
We had an issue with exporting files from one server and importing on another, using XML code exported from Studio: ERROR #6301: SAX XML Parser Error. Turns out that issue was down to CR/LF changes made when transferring the XML from one server to the other.
We're upgrading to IRIS 2020.1 from Ensemble 2018.x.
I have a lookup table class that compiles fine in Ensemble but in IRIS causes the following compilation error: "ERROR #9101: Global name 'HH.LookupLabResultsToPhysiciansD' for 'IDLocation' is too long, must be no more than 31 characters in length."
Is this length limitation a new restriction or could I have done something years ago to increase the maximum character length.
When I try to compile through Atelier (Compile Project), I noticed that in compilation with error it returns this message 'Failed to read /api/atelier/v1/ ...':
No additional Atelier files to synchronize. Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck Compile failed: Failed to read /api/atelier/v1/ERP/action/compile?flags=ck
I have been creating a class to handle file encryption by using GPG keys. I pushed my code out today and my encrypt and decrypt methods weren't working. About a half an hour later in troubleshooting I found out that it needed to be a syntax change. My method has three parameters to it. Examples below:
This is how I was calling it in the test system with no issues:
do gpg.Encrypt()
This is how I was having to call it in my production system to work with no issues: