Article
· Mar 28, 2019 2m read
ObjectScript error handling snippets

ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well.

22 5
19 3.1K

Hi Developers!

For those who want to participate in the Advent of Code 2019 and code with ObjectScript in IRIS, I created a very simple but handy Github Template.

Use the green button

to copy template in your own repo, clone the repo and run in the repo folder:

docker-compose up -d

you will get InterSystems IRIS 2019.4 Community Edition running with the template classes to load input data from files and Day1 solution.

This is also set up to start crafting solutions of Advent of Code 2019 and edit, compile and debug ObjectScript with VSCode addon.

Happy coding with Advent of Code 2019!

0 0
0 247
Question
· Nov 28, 2019
StreamContainer.

Hello,

I make some changes in our ObjectScript code between our prod environment and dev environment in the process 'Hl7AdtFileIsoslBp'.

The operation is a class with "EnsLib.TCP.TextLineOutboundAdapter".

In prod:

0 10
0 457

I have SQLCompute with SQLComputeCode on a couple of Properties in my class.

These work fin when I insert/update via ObjectScript or SQL from the ManagementPortal.

However, if I insert (create new record) via my C# app using the Caché ODBC DLL the SQLCompute is ignored, it does not run.

Is this expected InterSystems Caché behaviour? We are on latest IRIS platform.

0 7
0 386

I'm pleased to announce the latest version of extensions for ObjectScript. Just a month has gone since my latest update, and I already have something new to show.

Important. In this version connection to the server will be disabled by default. You have to activate connection through the settings:"objectscript.conn.active" = true.

5 12
1 996

Hello Everyone,

I'm want to know, what is more common for your company to use, the abbreviation syntax or the complety name of commands, and why?

Ex.

S VAR=10 / D FUNC^ROUTINE F 1:1:1000

Set VAR=10 / Do Func^Routine / For 1:1:1000

set var=10 / do func^routine / for 1:1:1000

Here in my company, we are familiar with the abbreviation syntax, because to spell is more faster.

2 35
0 927
Question
· Nov 18, 2019
REST service with 11G Sql

Hi, I asked last week and they gave me some little tips. But the truth is I still can't carry out this "Project".

I must perform a REST service, using Oracle 11 database. Eh tried anyway to achieve this.

The purpose is to make a REST service, using the database provided to me and use the procedure that is already created.

According to what I read, I made the connection via JDBC and I had no major problem

0 2
0 268

Hi Developers!

Often I find questions on how to install IRIS, connect to IRIS from IDE, setup the environment, compile, debug, maintain the repository.

Here below possibly the shortest way to set up all the environment and start development with ObjectScript on InterSystems IRIS.

Prerequisites

Make sure you have Git, Docker, and VSCode installed

Install Docker and ObjectScript extensions into VSCode

Sign in or Create an account on Github

Here we go!

5 9
5 1.3K

In the previous article, I have demonstrated a simple way to record data changes. At this time I have changed the "Audit Abstract Class" which is responsible for recording audit data and the data structure where the audit log will be recorded.

I have changed the data structure to a parent and child structure where there will be two tables to record the "transaction" and the "fields its values" changed on that transaction.

Take a look at the new data model:

6 4
1 938

I have a custom written date, setup as myDate in my application, which always behaved fine for years, and now it's acting a little weird.

When I run SQL in Display mode the date shows as 1/10/1841 for some but not ALL rows.

When I run the same exact query in logical Mode the date shows normal format, in my case, for example 10/1/2019. When the application is running is shows the incorrect date. When I run the terminal session and open a ref point and ask to write a date is shows 10/1/2019, but I am expecting internal format here - 65287.

0 4
0 279

Hi Everyone,

New Coding Talk, recorded by @Evgeny Shvarov, is already on InterSystems Developers YouTube:

GitHub Repository Template To Develop and Debug ObjectScript in InterSystems IRIS

https://www.youtube.com/embed/PumOI3q5Gdk
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

9 13
3 509

I must be missing something. We have done encoded PDF's in the past with the Encoded PDF in OBX.5.5. When I have used this code in the past I was only working with 1 OBX, but I have a case where I am having multiple OBX's and having to loop through them and I am renumbering the outbound OBX.

0 1
0 477

Hi Community,

As you may know, we successfully held InterSystems Developers Meetup in Boston at Global Summit 2019. And now it's time to find out which solutions development on InterSystems IRIS have been discussed!

Please welcome the Meetup video recording on InterSystems Developers YouTube Channel:

InterSystems Developers Meetup - Global Summit 2019

https://www.youtube.com/embed/PUnZwDxqEZM
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

2 0
0 199

Hi Developers,

New Coding Talk, recorded by @Evgeny Shvarov, is available on InterSystems Developers YouTube:

🎯 Creating REST API with InterSystems IRIS, ObjectScript and Docker

https://www.youtube.com/embed/5_R7dLKLbS8
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

1 0
1 448

I am reading the following code in ObjectScript:

GitHub repository

And there is a sentence which I am facing difficulties to understand:

kill ^OPNLib.Game.CWLF(..World)

I know that kill removes variables, OPNLib.Game are the package and subpackage, and ..World is a property. However what does CWLF mean?

You could think that it is the class' name, but it is:

0 2
0 181

Hi Everyone!

New video, recorded by @Stefan Wittmann, is already on InterSystems Developers YouTube:

SQL and Object Access

https://www.youtube.com/embed/i6AkBtB3F-M
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

4 0
2 248

Hi Developers!

When you prepare your modules for ZPM (InterSystems Package Manager) it expects the certain directory structure for ObjectScript source files.

ObjectScript in your source folder need to be stored by types in the following subfolders. E.g. if you have the source folder named as /src the structure should be as follows:

/src

/cls - for classes

/inc - for include files

/mac - for mac files

/int - for interpretable files

2 0
1 687

Hi All,

I have a class method, this can be any cache expression to execute (usually a class / method and args) and and args stored in a variable, for example;

set aa = "##Class(Utils.Test).Run(1,2,3)"

do aa

I tried using $classmethod(class,method,args..), by extracting the values but sometimes there can be no arguments, or arguments such as ;

("2019-01-01","1,2,3,4")

which causes issues while running the $classmethod, (i am using $P to extract the Class, Method and args).

Is there any simpler way of doing this?

0 4
0 288

We have a case where we have 1 message coming in, but then sending two messages out to the same location. Even with FIFO sometimes the messages get out of sequence depending on what is need to be done to the message in the DTL before send. Is it possible to call sleep or Halt or write some kind of a function to put a pause in a routing rule between two sends?

0 5
0 588

I've created a scheduled task that dumps HL7 messages to flat files. It uses the OutputToLibraryStream() method of EnsLib.HL7.Message. I'd like to be able to run it on a mirror member host whether it's primary or backup.

When run against a database that's mounted read-only, it works fine. However, when I attempt to run it against a mirror backup database, I get the following error:

#5002: Cache error: <PROTECT>%LoadData+7^EnsLib.HL7.Message.1

Tracing that back to the source, I find:

0 9
0 369