Hi,
Does anyone know why the SYNTAX error appears?
Thanks,
Tomer.
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,
Does anyone know why the SYNTAX error appears?
Thanks,
Tomer.
Hello community!
At the global summit in Phoenix, we (Lite Solutions) will be presenting a tool performing static code analysis on ObjectScript source files. You can see it in action at this URL:
Technically, the tool is a language plugin over SonarQube (http://sonarqube.org) and consists of three main parts:
The third point is where we kindly request for feedback.
Does anyone have any experience with getting, unfortunately, an older version of Cache to authenticate via SMTP to send email? I have verified that the settings are set up properly on the mailbox as I have successfully sent an email from a LAMP server, which comes from the same IP address.
If you have any thoughts, I would greatly appreciate it.
This is the error I receive
ERROR #6034: SMTP server connection failed during MAIL FROM command: <READ>zSend+105^%Net.SMTP.1.
when I run the following.
(Originally posted by Timur Safin on Intersystems CODE, 3/2/15) This code snippet is a routine that parses options saved in an arguments array. The subroutine "test" runs the code:
Hello Everyone,
I was wondering about the best way to initialize several variables, or several lists of variables.
Would it be better to write it like:
set (var1, var2, var3) = "value1" set (var4, var5) = "value2" set (var6,var7,var8) = "value3"
or
set var1="value1", var2="value1", var3="value1", var4="value2", var5="value2", var6="value3", var7="value3", var8="value3"
or
set var1 = "value1" set var2 = "value1" set var3 = "value1" set var4 = "value2" set var5 = "value2" set var6 = "value3" set var7 = "value3" set var8 = "value3"
When comparing the speed of each methods:
The following code snippet is a REGEX that validates characters that are not in English, as well as English characters. The class method "test" takes an email address and validates it based on this additional criteria:
(Originally posted by @Eduard Lebedyuk on Intersystems CODE, 6/26/14) This code snippet determines the difference between two ObjectScript lists. The class method "test" runs the code, and its parameters are detailed in the comments:
As a developer, usually I'm concerned about how my code health is, and how the other coders code can affect to my own work. And I'm quite sure most of us feel very similar.
In our company we use a Static Code Analysis tool to analyze code for different languages to ensure we are writing high quality and easily maintainable code by following a few best practices in terms of code structure and content. And the question was: why should be different for Caché ObjectScript language?
The REST webservice works perfectly when run on SOAP UI. This end point server is an https site that uses basic authentication (uname and pwd). But when I run the request through an Enslib.Rest.Operation using a configured SSL and stored credentials, I get an "unauthorized" error, unless I explicitly hard code the password in the operation class. HS Version is 2014.1 .
I have 2 questions. Pardon me, they are both related!!
Hi,
is there a way to tell Caché to ignore the order of elements when hosting a SOAP-based webservice?
At the moment I keep getting the Error-Code #6237 (Unexpected tag in XML input) when the request is not in the exact same order as defined.
Looking forward for your answers.
Regards,
Thomas
The following code allows a user to view the audit settings of their instance. Run the code by running the class method "test":
How to Make a Https/SSL Request in Caché ObjectScript ? If possible please provide some working example with some https url.
Is there any COS API to create the database (with designated path) and the namespace ?
Also, the API to attach a given database to a given namespace?
Thanks.
Hi, Community!
Have a question for general discussion.
In ObjectScript we have cls for classes and mac code, which both compile into int code.
Is there any reason when you use mac instead of cls for non-persistent classes?
For me the benefits for cls are:
1. Inheritance and other OOP features
2. Auto-documented code
For mac one visible benefit is easier call in terminal:
do method^Utils(p1,p2)
vs
do ##class(Package.Utils).method(p1,p2)
What is your choice and why?
I have a class that has a property calledTags (like DescriptiveWords, but tags), where multiple tags are possible. I am trying to decide on list of Objects vs. array of Objects.
Based on this post: https://community.intersystems.com/post/querying-list-property-sql, sounds like using an array of Objects is the better way to go. Indeed, I already noticed that it's not possible to have duplicates when using an array of Objects.
However, I am unable to make my queries on the array of Object use an index.
Hello everyone,
what does it mean: <INVALID OREF>zgetFile+8^User.Read.1
(getFile is my ClassMethod and Read.cls is my class)?
I just try to read/load a file.
Im using below code to display page number. But i only display as 1,2..etc. I need to display it as I,II,III..etc...
special="page-number"
I am trying to write a generic process that will take any incoming message but would like to know where it came from so in my code I would like to do something like this
If (Document.Source="some serviceorProcess").Just to be clear in the route you get these features is there a way of accessing them in code
Hi everyone,
I am still learning the platform for a student project and have to do some streaming and data analysis next. Since for my case I have no "live api" I wanted to just stream json files and output the data as it comes in from the files. (basically to emulate a incoming data scenario)
So thanks to the documentation and community posts I have figured how to create a stream and read data from a JSON but since I'm also new to JSON I have some parsing problems. I don't know how to access subarrays/sub-objects via objectscript.
I came across this behaviour when debugging some Cache ObjectScript code. I have provided a simple example below.
Example 1:
START ZBREAK /TRACE:ON:"C:/temp/zbreak_trace.log" ZBREAK *VAR1:"T" ZBREAK *VAR2:"T" ZBREAK *VAR3:"T" Set (VAR1,VAR2,VAR3)="" Kill VAR1,VAR2,VAR3 Quit
Trace Output:
Trace: ZBREAK SET VAR3="" at START+5^TRACE Trace: ZBREAK KILL VAR1 at START+6^TRACE Trace: ZBREAK KILL VAR2 at START+6^TRACE Trace: ZBREAK KILL VAR3 at START+6^TRACE
$ZV value:
Cache for Windows (x86-32) 2017.1 (Build 792) Mon Mar 20 2017 20:20:07 EDT
I am trying to read some binary data from a local file or through socket.
The binary data is like H.264 codec, I need to read data BYTE by BYTE (even BIT by BIT) and decide the next step based on the data read so far.
I check the documentation and it seems like most of the sample focus on human readable IO, ie: LINE by LINE.
Could I achieve my goal through COS?
Thanks.
Typically, I have time to review the documentation, which I'm sure is here. However, I have a workaround (TEST1) but I was wondering if anyone could assist me in advising how I would need to adapt the curly brace snippet (TEST2) to provide the same result.
Thanks for any help you can provide.
TEST1(STATUS=1) K (STATUS)X "S MSG=$S(STATUS:""HELLO"", 1:""GOODBYE"")"W !,MSGQTEST2(STATUS=1) PUBLIC {X "S MSG=$S(STATUS:""HELLO"", 1:""GOODBYE"")"W !,MSG}I need to do an ordering, within another order, but it is not ordering.
I have a serial object:
Class EmbedObj Extends %SerialObject
which is stored as a property of another object
Class ContainerObj Extends %Persistent
Property InnerObj As EmbedObj;
Property Foobar As %String;
Question:
From within the context of an instance of EmbedObj, how can I navigate to the containing instance of "ContainterObj" and find that value of its Foobar property?
Harder Question: Is there a way I can do this as part of SQLComputeCode? (my EmbedObj has a Calculated property which now needs to depend on the value of property Foobar of the containing object).
Hello,
If this question is in the wrong section, I apologise.
Has anyone ever used Cache Object Script to connect to any hardware such as a sensor?
What I mean is this :-
Lets assume that code has been written in Cache Object Script where it can detect breaks in electrical connections.
Hi,
I was wondering if there is any way to count elements from an array. I guess not as an array could be multi-dimensional and that would be a problem to return the number of elements inside the array.
As an example:
Information about arrays: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…
Thanks
Hi, Community!
$CASE is a fine syntax sugar for "Ifs" with one-line/one-word expressions, like in docs:
SET daynum=$ZDATE($HOROLOG,10)
WRITE $CASE(daynum,
1:"Monday",2:"Tuesday",3:"Wednesday",
4:"Thursday",5:"Friday",
6:"Saturday",0:"Sunday",:"entry error")But if my expression for a current case is a multi-line business logic? Can I use "{}" somehow or better go with "IF" instead?
%XML.Reader.OpenFile fails with SAX XML Parser-Error: <STORE> on importing large (1.5 GB) xml file. Any workaround for it?
My goal is one-time import of the file using classes generated by its XML schema.
Looking for official guidance concerning the pitfalls of mixing Object Script with legacy MUMPS in the same .INT and/ or .MAC. Thanks, R
Hi,
I'm trying to send emails to a distribution list but it doesnt work. However, When I send emails to individual emails it works fine. Is there a configuration that I need to be checking or enable?
I'm doing it within a Business Operation: