#Compiler

0 Followers · 83 Posts

The tool that compiles source code to another form of executable code.

Article Eduard Lebedyuk · Feb 5, 2016 11m read

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!

17
7 7568
Question Jenna Makin · Sep 30, 2017

hi-

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?

9
1 1624
Question Raymond Shadow · Jun 24, 2020

How do I compile a file through the command line?

I am generating a very basic csp page in a bash shell, it is generating fine and displays what I want to see as long as I go into studio and compile it .  This defeats my purpose of having the page and I am having no luck figuring out what I am doing wrong.  I think the issue has to do with the file not being included when I compile from command line.

Ver is 2017 running  RHEL 7

From command line I see

TST 3f2>DO $SYSTEM.OBJ.Compile("csp.vvmaccessnewrds","h")

3
0 713
Article John Murray · Oct 25, 2019 1m read

When dealing with a support issue of one of our Deltanji source control sites this week I learned that if you're using InterSystems versions earlier than 2018.1 on Unix-type platforms it's possible that a class you export in UDL format will subsequently fail to import. So I'm posting this information here in case it helps other folk.

0
0 303
Article Sean Klingensmith · Nov 18, 2016 10m read

As a developer, you have probably spent at least some time writing repetetive code. You may have even found yourself wishing you could generate the code programmatically. If this sounds familiar, this article is for you!

We'll start with an example. Note: the following examples use the %DynamicObject interface, which requires Caché 2016.2 or later. If you are unfamiliar with this class, check out the documentation here: Using JSON in Caché. It's really cool!

##Example

2
3 3506
Question Cole Risch · Apr 10, 2019

First, my $ZVERSION:

Cache for OpenVMS/ALPHA V7.x (Alpha) 2010.1.6 (Build 952_2 + Adhoc 17754) 3-JAN-2018 14:32:54.07

Second, my issue:

I believe my current villain is “incremental compiling.” I was able to compare early compile output with later compile output:

Compilation started on 04/10/2019 10:46:32 with qualifiers 'cuk' Compiling class UnitTests.Task3496 incremental compile detected Compiling routine UnitTests.Task3496.2 Compilation finished successfully in 0.800s.

... several compiles later...

3
0 462
Question Flávio Lúcio Naves Júnior · Apr 3, 2019

Hello everyone,

I'm trying to migrate the IDE for programming in COS, we normally use the Studio, but we want to use a more modern IDE. Our team has knowledge with Visual Studio plataform, but we couldn't configurate the compiler and terminal, I installed the extension InterSystems ObjectScript and tried to configurate to connect with my local machine, unfortunately the connection don't sucessed.

Someone has material for how i can connect and compile? Some material i saw show how to use the compiler, but not how can i do the configuration.

Best regards,
Flávio. 

6
0 1183
Question Michal Tomek · Jun 21, 2016

I have just imported our Ensemble project (not a really big one, like two man-years) into my MacBook Air  Ensemble 2016.3 instance to test many things (document model, etc.), Atelier among the others.

The "Production view" is not here, and I miss it.

The opening of Diagram Editor for BP is pretty hidden. I would even like having a switch, which would default to the Diagram Editor. 

Anytime I click on the Open Diagram Editor, it waits for a while, ten produces an error and only then I can see the diagram.

The error says: Your Studio browser is no longer valid... etc.

2
0 557
Question John Murray · Oct 2, 2018

Using our cool new debugging extension for Visual Studio Code I'm trying to debug a CreateProjection method of a class, but when I compile it the work apparently gets done in one of the worker jobs, so my breakpoint never triggers.

Is there a compiler flag or qualifier to force the compilation to be done in-process rather than getting handed off to a worker job?

4
0 516
Question Lucas Fernandes · Jul 18, 2018

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

Does anyone know what can it be?

6
0 719
Question Thiago Zenaro · Jun 12, 2018

Hi community!
Is there any way to create new method keywords?
For example:

ClassMethod TestOne() [ MyKeyword = MyValue ]
{
    // Implementation
}

Another doubt (maybe another topic)
How can I generate new methods at compilation time for the same class?
I tried method generators, but It only gets compiled when I compile for the second time.
I also read this comment but I could not find out how to generate the methods and get them compiled in the first compilation.

For example:

Class util.Test
{

ClassMethod TestOne()
{
    Write 1
}

ClassMethod TestTwo()
{
    Write 1
}

}

Expected:

13
0 634
Question Alexey Maslov · May 7, 2018

During programmatic classes compilation performed by the code like this:

set status=$system.OBJ.Load(updaterFile,"cruk-d",,.resList)

strange messages appear in console log, e.g.

05/06/18-15:54:12:424 (308512) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523
...
05/06/18-16:17:45:305 (4224) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523
05/06/18-16:22:30:485 (4224) 0 oops: was expecting crc 0x21e96e85,5a4c8b2c for rtn (Update.Import.1) rbufnum-15523...(repeated 3 times)
12
0 704
Question Thiago Zenaro · May 3, 2018

Hi community.

I want to create a custom list inheriting %ListOfDatatypes in order to implement some methods like Map, Filter, ForEach, but I have some questions.
Just to mention, I have already read the topic about DeclarativeCOS.

When I define a property like following, caché uses %Collection.ListOfDT or %Collection.ListOfObj, as it's shown in the documentation

Property TestListString As list Of %String;

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_propcoll#GOBJ_propcoll_def.

1
0 745
Question sween · Mar 12, 2018

Is there a way to enumerate the compilation status of a package?    

currently after deployment we are doing something like this to validate a successful load and compile of classes:

successful_compilation_count=`grep -a "Compilation finished successfully" output.log | wc -l`
successful_load_count=`grep -a "Load finished successfully" output.log | wc -l`

is there a method to do this where it is a little bit more elegant/dynamic without having to maintain counts for comparison ?

4
0 441
Question John Murray · Jan 30, 2018

In part of this post in 2016 @Eduard Lebedyuk asked if anyone knew what is meant by an "expanded class", as referred to in the text that appears when we run the ShowQualifiers classmethod of %SYSTEM.OBJ thus:

SAMPLES>DO $system.OBJ.ShowQualifiers()
...
            Name: /checkuptodate
    Description: Skip classes or expanded classes that are up-to-date.

3
0 514
Question Robert Hanna · Oct 23, 2017

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!

10
1 1011
Question Robert Harris · Nov 13, 2017

"Help me, Obi Wan Kenobi"?

I’ve hit the wall. I’m a one person shop who wants to start developing Cache on a mac using Eclipse/Atelier, after using Studio for the last 5 years. I’ve installed the 1.1 beta plugin, watched 6 or 7 videos from the September conference, tried several times to work through the cheat sheets, only to have connection issues or compilation issues, so at this point, I’m feeling very frustrated. The videos were interesting, but generally didn’t work as tutorials for fundamental programming operations, for me.

3
0 374
Question CJ H · Sep 27, 2017

The definitions of these two compiler keywords looks very similar to me.

Is there any difference between these two keywords ?

When I declare a parent class as Abstract, its child class could be compiled successfully.

However, when I  declare a parent class as NoExtent, some compile errors about storage references get pop up for its child classes.

Thanks.

1
0 390
Question Sean Connelly · May 10, 2017

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.

I came across $$$TEXT reading the docs...

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

20
0 618
Question Rubens Silva · Sep 4, 2017

Hello, I just noticed that the following query is not allowing when using cached queries.

The compiler will accuse the code about missing a closing quote.
Just so you know, if I use this query dynamically it works, so I guess it's related to the code linting.

Query T() As %SQLQuery [ SqlProc ]{SELECT TOP 3 JSON_OBJECT('lit':'Employee from','t':%TABLENAME,'name':Name,'num':SSN) FROM Sample.Employee}

The bold part is what is causing the error.

Version 2017.

4
0 453
Question Tom Philippi · Aug 14, 2017

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? Rewriting the WSDL is not an

7
0 844
Article Eduard Lebedyuk · Oct 18, 2016 7m read

In this article I would like to tell you about macros in InterSystems Caché. A macro is a symbolic name that is replaced with a set of instructions during compilation. A macro can “unfold” in various instruction sets each time it is called, depending on the parameters passed to it and activated scenarios. This can be both static code and the result of ObjectScript execution. Let's take a look at how you can use them in your application.

3
0 2468
Question Maarten Van den Vreken · Jul 18, 2017

Hi all,

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.

8
2 834
Question CM Wang · Jul 18, 2017

I have a class and I would like to dynamically change its selectivity attribute in run-time and then call $system.OBJ.Compile to

recompile the class. I have changed the selectivity to a global, but it seems like it does not work. Any suggestions? Thanks.

<Property name="field1">
<AverageFieldSize>8.91</AverageFieldSize>
<Selectivity>^selectivity</Selectivity>
</Property>
 

3
0 452
Question Thiago Zenaro · Jul 13, 2017

Hi everyone

Is there any way to change a class definition (especifically a query definition during the compilation time)?
The idea is: 
    I have an abstract class with a parameter where I will define the ROWSPEC of a query and some methods to populate e temporary table
The implementation class will override the parameter, specifying the ROWSPEC of this implementation, and the methods will populate the rows in the same format as the ROWSPEC.

4
0 713