Hello!

This article is a small overview of a tool that helps to understand classes and their structure inside the InterSystems products: from IRIS to Caché, Ensemble, HealthShare.

In short, it visualizes a class or an entire package, shows the relations between classes and provides all the possible information to developers and team leads without making them go to Studio and examine the code there.

If you are learning InterSystems products, reviewing projects a lot or just interested in something new in InterSystems Technology solutions — you are more than welcome to read the overview of ObjectScript Class Explorer!

21 35
3 5.5K
Discussion
· Mar 3, 2016
Anyone using Visual Studio Code?

Is anyone in the fine community of developers who work with ISC technologies looking at Microsoft's Visual Studio Code offering?

One of Bill McCormick's recent posts about Atelier referred to Visual Studio being considered the best IDE. Granted, Code is far less of a tool than VS, and probably always will be. But it claims to be open source and cross-platform, i.e. Linux and OS X as well as Windows.

8 26
3 5K

The topic of for/while loop performance in Caché ObjectScript came up in discussion recently, and I'd like to share some thoughts/best practices with the rest of the community. While this is a basic topic in itself, it's easy to overlook the performance implications of otherwise-reasonable approaches.

24 21
3 9K

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status.


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

5 21
2 3K
Article
· Feb 5, 2016 11m read
Class Queries in InterSystems IRIS

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 17
6 6.9K

Hi!

I believe the simplest is (to work with csv delimited by ";"):


set file = ##class(%File).%New( "data.csv" )
    set sc = file.Open( "R" ) 
    if $$$ISERR(sc) quit    ; or do smth

    while 'file.AtEnd {
        set str=file.ReadLine() 
        for i=1:1:$length( str, ";" ) {
            set id=$piece( str, ";" ,i ) 
            write !, id  // or do smth
        }
    }
    do file.Close()

Possible options:

different variants of error handling with sc code.

Embrace while loop into try/catch block.

And what's yours?

3 16
0 6.4K
Question
· Jun 14, 2016
Get variables list

Hello!

In Caché there is a way to print all current variables using write command without arguments:

USER>set Einstein = 1879
USER>set Mozart = 1756
USER>write
Einstein=1879
Mozart=1756

But is there a way to get a list of this variables? I am looking for something that would return value like $LB("Einstein", "Mozart") for this case.

Thanks!

2 16
0 1.5K
Question
· May 18, 2016
Ensemble HTTP OnProcessInput

I am just trying to make a quick hand off HTTP production. I have the class built and compiled onto the server and the production is running as a service. When the production is called (by an inbound job) I can see that the HTTP.InboundAdapter is being used successfully and the stack continues all the up to ProcessInput where OnProcessInput is called in Ens.BusinessService.

0 15
0 1.4K

Hello,

I am still a beginner with COS and am struggling with these concepts. While digging through the official documentation will eventually tell you everything you need to know, getting started is nevertheless not an easy feat...

Is it possible to create a "lists/array/multidimensional 101" page for beginners? And, for instance, its interaction with $data, what it means to use "as list of something" or "as array of something", how to walk lists, how to add/remove elements, how to extract sublists etc?

1 12
0 514

Have some free text fields in your application that you wish you could search efficiently? Tried using some methods before but found out that they just cannot match the performance needs of your customers? Do I have one weird trick that will solve all your problems? Don’t you already know!? All I do is bring great solutions to your performance pitfalls!

As usual, if you want the TL;DR (too long; didn’t read) version, skip to the end. Just know you are hurting my feelings.

22 11
2 2.5K
Article
· Jul 22, 2016 16m read
Using Regular Expressions in Caché

1.About this article

Just like Caché pattern matching, Regular Expressions can be used in Caché to identify patterns in text data – only with a much higher expressive power. This article provides a brief introduction into Regular Expressions and what you can do with it in Caché. The information provided herein is based on various sources, most notably the book “Mastering Regular Expressions” by Jeffrey Friedl and of course the Caché online documentation. The article is not intended to discuss all the possibilities and details of regular expressions. Please refer to the information sources listed in chapter 5 if you would like to learn more. If you prefer to read off-line you can also download the PDF version of this article.

19 11
6 5.4K
Article
· Jun 13, 2016 1m read
Debug: using locks for breakpoints

Hi, Community!

Want to share with you one debugging approach from the Russian forum.

Suppose I want to debug the application and I want it to stop the execution on a particular line.

I add in code this line:

l +d,-d

When I want to start debugging in this line I block d in terminal

USER> l +d

And execute the app.

The app stops on this line and lets me connect to it with Studio debugger.

0 8
1 593

Hi,
I've organized my repository using TortoiseSVN. I was careful to use only svn commands while creating my file structure. Now all Subversion commands are working at the command line but not from within my IDE (Cache Studio). Basically I'm trying to write a plug-in for my IDE to use Subversion from within the Studio. Trying to integrate Subversion into my IDE, something like Subclipse, but for Cache Studio. The error occurred after reorganizing my code into directories. For example at the command-line, svn info and svn status and all other commands work perfectly. All Subversion commands work at the command prompt!

0 8
0 1.3K