Hi
Following API:
http://api.aladhan.com/v1/gToH?
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
Following API:
http://api.aladhan.com/v1/gToH?
I have a %Stream that I want to insert some text into the middle of. I create a new stream called pNewContentStream from the original stream, then I do a MoveTo in pNewContentStream to get to the byte position I want to insert into but when I do my Write, my pNewContentStream gets obliterated with only the text that I wrote, the original content goes away and all I'm left with is my Write text.
Method AddContentTypeCode4(pContentStream As %Stream.GlobalCharacter, Output pNewContentStream As %Stream.GlobalCharacter) As %Status { Set tStatus = $$$OK try { Set tTemp = pContentStream.
Hello,
I’m looking for a way to find out which category of portal a connector belongs to.
I looked at the class ‘Ens.Config.Production’ and ‘Ens.Config.Item’ but without success.
An idea about the ‘ObjectScript’ code to design?
Best Regards.
Hello,
I'm experiencing a recurrent problem that I haven't found the way to solve, so I'm coming here with the hope somebody can give me a new approach.
To make it short: we are creating categories on-demand to be able to place the maximum numbers of workers in memory, avoiding the limits established by system categories. But from time to time, one of this creation fails and system is no able to start the queue. The error we are getting is:
ERREUR #7823: Invalid work queue manager category supplied 'User.65733'.1<INVALID OREF> The code is very simple:
s ^%SYS("WQM","MaxActiveWorkers","User.I am executing the command:
set fileComp = ##Class(SYS.Database).FileCompact(obj.Directory, freeSpace, .actualFree)
where obj.Directory contains the location of the current database
This executes correctly. However, the resultant OREF object does not contain any displayable properties but rather is of the value:
"0 "_$lb($lb(380,,,,,,,,,$lb(,"%SYS",$lb("e^zFileCompact+38^SYS.Database.1^1","e^^^0"))))/* ERROR #380: Completed but skipped some blocks, details recorded in the console log. */
Which is what I expected.
I have a terminal script that queries sys.process' and then parses the results writing to a logfile. As part of the processing of the results, each row of the result set includes an element from the static string. But I am not clear on the scoping of the static string. The write statement sees the static string as undefined. What I want is something to the affect:
set statStr = "aa|bb|.."
set sqlStatement = xxx
set tState = ##class(%SQL.Statement).%New()
set qStat = tState.%Prepare(< sql statement> )
set rset = tState.%Execute()
WHILE rset.
When overwriting the Read method (that has a %CacheString return type) on a new class that inherits %Stream.FileCharacter class, returns an error about incorrect return type, must be Binary, even if it matched the real signature.
Looking at the compile global information we can see:
^oddCOM("%Stream.FileBinary","m","Read",42)="%Library.Binary"
After further investigation we realise that there is a generator method looking at the OdbcType class definition.
Setting LONGVARCHAR results in:
^oddCOM("User.CStream","m","Read",42)="%Library.String"
Since I saw many posts on Developer Community related to Python, and the very good articles and application written by @Eduard Lebedyuk I was wondering: "As a Object Script developer, why would I want to use an other language in Object Script? If I ever need to execute something in Object Script, I would do it in Object Script!".
I thought those functionalities to use other languages in Object Script were made only for other languages developers who have to write Object Script code.
Recently I had to parse a huge CSV file : 1.7Gb and more than 5 millions lines.
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
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.
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 = file.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 :
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