Hi,
What is the difference between $Increment and $Sequence functions ?
Thanks
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.
Hi,
What is the difference between $Increment and $Sequence functions ?
Thanks
I have an ObjectScript class with a Log property of type %Stream.GlobalCharacter. I need to search the end of each of the logs - is there a way to extract the last 10 lines of the Log stream for each object via SQL? Or is my only option to write an ObjectScript routine to walk the table and inspect each Log property one by one?
Thanks!
The goal is to construct a comma separated string, using a loop but the same way $listtostring(var,",") would do (i.e. "a,b,c,d,e,f,g,h" without starting or ending comma).
What is the best way to do it, concerning the readability of the code and its performances?
To do so, there are more than 5 methods, but in this example we will test 4 :
1) using a "if" in the loop
set str=""for ... { if str'="" { set str = str_"," } set str=str_myval}2) using a set
set (str,sep)=""for ... { set str=str_sep_myval set sep=","}3) using a $list construction and transform to string with
Hello everyone
I use cache script, I would like to know from you if there is any function or class in the cache where I can get the start and end date of a given month:
Example: What is the first and last day of the month of February 2015.
Grateful.
Davidson
Hello,
When using GetFieldStreamRaw(), by passing in a variable instead of using an output for the Remainder, will this affect how it is stored into a segment in a cloned message?I know it would usually output the remaining fields of the segment but in order to conform to a supplier's spec, they'd require "^^PDF" rather than the rest of the segment.Because the segment becomes immutable, the code below seems to be the way to do it.
Does anyone know how to set an email as High priority when it is sent using a %Net.MailMessage object? Somehow I can't seem to put my finger on it.
Thanks!
Hi,
I'm processing POP3 emails using the standard EnsLib.EMail.InboundAdapter adapter and %Net.MailMessage. I'm basically processing documents that are attached to received emails. This works fine if the document is simply attached to the email itself. But some systems are sending documents that are attached to an attached email which has content-type = message/rfc822.
How do I get the attached file from the attached email?
I'm using the following code to iterate through the email parts..
Hello Everyone
I am new to cache. I know there are 2 types of methods in cache. One is Instance method (Which can be call through object creation of particular class) and other is Class methods (which can be call through ##Class(MyPackage.Car).CarModels()).
I want to know the difference when to create a instance method vs when to create a class methods.
Thanks in advance!!.
In Java we can use reflection to get the method arguments in an array, we can also get the name of argument.
Do we have similar features in ObjectScript?
Thanks!
Our client is a UK-based company with subsidiary operations in the USA, France, Germany and China. The Company supplies materials which are used for research, development, and specialised manufacturing applications worldwide. The Business Intelligence department is a small but integral part of the company. The department provides support to the wider business through information systems. We are currently seeking a Business Intelligence Caché Specialist that will be responsible for supporting and developing the existing Caché system, which is used widely within the business. We are based in
Hi Community,
Enjoy watching the new video on InterSystems Developers YouTube:
⏯ Visual Studio Code for ObjectScript: Server-Side Source Control
After linking in Oracle Table with Field Column's Data Types of NUMBER, my updates into these table fields are resulting in data that is being rounded to 2 decimal places. I insert a record with 1234.1234 and 1234.12 is stored.
It appears Cache xDBC might be manipulating my values prior to sending to Oracle. Is there a setting or system parameter that is controlling this? If so, is there a way to relax this from occurring so the values I send are being stored in Oracle with the same values?
Hey Developers,
New video is already on InterSystems Developers YouTube:
⏯ Visual Studio Code for ObjectScript: Choosing an IDE/Source Code Combination
Hey everyone as you may know I am a beginner and I am kindly asking for some assistance in a problem I have been solving. The problem is that I am calling a user defined function within a procedure called occupiedseatsAdj and the compiler comes up with this error.
| <NOLINE> | There has been an attempt to refer to a nonexistent routine line. |
From what I understand I can call a user defined function from within a procedure (correct me if I am wrong) as shown below.Is this the correct way or should I create a .Mac file and include it somewhere within the above mentioned cls file ?
Hi developers,
We have just published an update to the Deltanji version control extension for Visual Studio Code.
When used in certain Deltanji workflows, triggering an automatic checkout on first keystroke could result in the developer working on an outdated copy of the code and only being notified of this later when saving their changes. In order to prevent this from happening checkout now reloads the document immediately.
Error messaging has been improved in two areas - when attempting to cancel code that is not checked out, and when trying to register new code onto a withdraw system.
We have also improved interoperability between the Deltanji extension and the InterSystems ObjectScript one, as well as its handling of multi-component objects.
If you're already a user of Deltanji then your extension with automatically update. You can find out more information on Deltanji and the latest release here.
Hi All I am a beginner and I am learning Objectscript and I would appreciate a steer regarding a problem I am solving.
The issue I have spent some time on resolving without success is that I have the stream listed below and as you can see it has some gaps in it.
Stream
das
is
wp
dsa
nmkHere is the import method
IF ##class(%File).Exists(dir) '=1 {
write !, "Unable to Open: "_dir
QUIT
} ELSE {
write "File: "_dir_" is open"
}
// instantiate a new class called file
set file = ##class(%Stream.FileCharacter).%New()
// create a new variable called sc
set sc =Hi folks!
Is there a way (function) to know the name of the database for data of the current namespace?
I take the case where we have one database for data and another database for code in a namespace.
Thanks!
I have been working within Objectscript for a few months and I am seeking assistance today because all of the help files within the docs.intersystems.com domain are currently down and they wont be back up until next week. (I raised a special ticket for this)
I have been trying to figure out how to convert a binary number 0101001 in to a decimal number using a variable called CNumber and I have tried using the method below and it hasnt worked.I think it may be due to the fact that this assumes an array or some sort.
Hi,
I am getting following error while compiling a routine :
Compilation started on 08/05/2021 12:58:31 with qualifiers 'cku /checkuptodate=expandedonly'
Compiling routine : demoroutine.mac
ERROR: demoroutine.int(1) #1026: Invalid command : 'write "Use one of the following options"' : Offset:6 [write^demoroutine]
TEXT: write "Use one of the following options"
Detected 1 errors during compilation in 0.022s.
Please note that Routine contains just a below simple write command :
write "Use one of the following options"
Thanks
Hi folks!
Want to share a lifehack with you on ObjectScript highlighiting withing VSCode for script files.
Script files are just files with lines of ObjectScript that we feed anywhere, e.g. into IRIS during Docker baking procedure.
Typical usecase - here is the Scriptfile
here is the Dockerfile where we feed it.
And here is how it looks like usually in VSCode:

Coudl be more beautiful, right?
Hi community,
This is another article about how to perform actions that you can do in the web portal but via code.
Today.... Add a business item in your production by code
Hi,
How to check if data string contains Unicode characters?
Thanks
Hi community,
I'm going to publish several articles on how to perform actions that you can do in the web portal but via code.
Today.... Web Applications via code
I have a routine tag that takes an argument and I want this argument to be an array reference. So I try something like:
do mytag(.myarr)
The mytag tag, adds subscripts to myarr.
When I evaluate myarr after the tag call, only the subscripts passed in are retained in myarr. The subscripts added by mytag are missing. Is there a way to pass an array so it will behave the way I want it to?
Hi all,
Are there limitations to the size of a file or stream that %XML.Reader will parse?
I am trying to parse a large, 573MB, XML file using either the 'OpenFile' or 'OpenStream' methods, but both return errors.
When I try to use the 'OpenStream' method I get a 'ERROR #6301: SAX XML Parser Error: input ended before all started tags were ended' error',
and when I try the 'OpenFile' method I get a 'ERROR #6301: SAX XML Parser Error: <STORE>'.
'%XML.TextReader' appears to parse the file OK, so I may be able to get use that as a workaround, but ideally I would like to get '%XML.Reader' working.
Regar
Hi,
When for any particular reason I need to update a record and don't want to pull the triggers, the keyword %NOTRIGGER can be used. But I've been trying to do the same when I change the row using the object approach, but I can't find it. Anyone knows if it's possible to avoid pulling triggers when working with objects?
Sadly, the utility "DISABLE^%NOTRIGGER" doesn't seem to exist ;-)
Thank you,
David
Hi,
What is the difference of class normal and date/time property and how to use in the script and what is the use of MINVAL and MAXVAL parameters?
Thanks
Hi!
Does anyone have a cleaner approach than this for looping through grouped NTE segments in order to set the segment ID in an ORM? I am aiming to avoid the NTE segments that may follow the PID segment and find the NTE's that follow the OBR segment. By using the below If statement in the While loop, I'm finding NTE's that have comments in the fourth field (PID NTE's tend not to have these in the messaging I'm seeing, I'm awaiting confirmation on this), as well as finding my newly inserted NTE segment using $FIND to locate the colon (I've concatenated some values).
Although this code is
the start date must always
be the first day of the effective salary month.
Good afternoon I am making a method of a class that I want to return a list of objects of another class that I have defined, example:
ClassMethod myMethod() As list of MyPackage.MyClass
{
}
But it gives me a syntax error, I try this and it works:
ClassMethod myMethod() As %ListOfObjects
{
}
But I would like to keep the typing.
Is there a way?