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"
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.
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.
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 !,MSG Q TEST2(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:
Set SendList="grouplist@email.com, eric@email.com" f a1=1:1:$l(SendList,",") s ToAdd=$p(SendList,",",a1) d .Set Mailer = ##CLASS(%Net.SMTP).%New() .Set Mailer.smtpserver = "10.xx.200.000" .Set Msg = ##class(%Net.MailMessage).%New() .Set Msg.From="manager@email.com .Do Msg.To.Insert(ToAdd) .Set Msg.Subject = "Sample Email to distribution list" .
Sometimes, we need to copy part of the properties of an object into a different one.
The simplest thing would be to do the following:
Set obj1.FirstName = obj2.FirstName
Set obj1.SecondName = obj2.SecondName
What happens if the object contains a large number of properties? or we just want to extract an important group of data, and complement the information in another object?
Having the following classes:
Class Kurro.PersonalInfo Extends %Library.Hi ,
Does anyone know how to dynamically set a variable, for example
set Counter = 1
set x_Counter ="test" in Cache Object script. I tried with EXECUTE
Thanks
A function iterates global ^data(a,b,c) with $order using 3 nested for-loops. At certain point, for example with a=10, b=20, c=30, the function exits and later has to resume the iteration from the same point. What could be easiest way for it? My solution looks too ugly.
I was wondering if there was a way to easily identify the node depth of a global.
Take the following global example. Is there way to determine the depth is 3?
s ^global("first","second","third")="some^info^here"Morning guys I have a SQL operation that I use to read data and results to a record map. But seems to have trouble saving the objects to a record map as I get this message
ERROR ErrException:
zInsertObject+2^%Library.RelationshipObject.1 -- logged as '-' number - @''
please help here is my code let me know if I missing anything thank you in advance
Method OnRequest(pRequest As DQToolsSet.PrimaryMessageREQ, Output pResponse As HSCIC.DBS.RequestRBAT) As %Status
{
#dim status as %Status=$$$OK
#dim resultSet as %SQL.StatementResult
set pobject=##class(%FileCharacterStream).
I've collated a list of public Caché Projects that I've been able to find through GitHub topics and various other searches, let me know if I have missed any and I will add them to the list.
The full list is here...
https://github.com/SeanConnelly/Public-Cache-Projects/blob/master/README.md
I've been writing ObjectScript for a long time and was a little surprised by this behavior so I'd like to understand what is going on.
I was doing a peer review on some source which had roughly the equivalent of the following line:
Set myRecord = ##class(MyObj.Record).%OpenId(id) Set emailList = previousEmails_","_myRecord.RecordGroup.
Hello community,
I need to perform some processing-heavy operations on a set of input objects and I would like to utilize more than a single processor core to do the heavy lifting.
Is there any way to call methods in parallel and wait for the results in a blocking way?
Basically, I am looking for an equivalent of the pythonese
with Pool(n) as p:
results = p.map(function, data)
Thanks
Jiri
EDIT: Correct English :)
This series of articles aims to address the following topics:
WRF to below example my idea is to check whether red is present in the list mylist. You can very well use LINQ on enumerable in C#
mylist.Where(x => (x.Property2 == "red")).ToList().Count;
set mylist=##class(%ListOfObjects).%New()
For i=1:1:2 {
S object = ##class(User.NewClass).%New()
S object.Property1=i
S object.Property2="red"
do mylist.Insert(object)
}It can be done with iterating over mylist
for j=1:1:mylist.Count(){ Set item = mylist.GetAt(j) If (item.Property1 = "red") { // get the count } //set exist = item.Find("viv",1) }
Hi Guys,
Can you please advise on the below queries.
Query 1:
Example 1:
S a="345",b="arun",c="kumar",d="hi",e="yello",f="orange"
Example 2:
S a="345" S b="arun" S c="kumar" S d="hi" S e="yello" S f="orange"
Can you please advise me, which one is performance wise is better.
Query 2:
Example 1:
S:a=1 R="Arun"
Example 2:
I a=2 R="Arun"
Please advise me, which one is giving better performance in this.
Any lead would be appreciated.
Thanks,
Arun Kumar Durairaj.
Set httprequest=##class(%Net.HttpRequest).%New()
Set httprequest.Server="www.intersystems.com"
Do httprequest.Get("/")
Do httprequest.HttpResponse.OutputToDevice()
Do httprequest.Get("/cache/")
Do httprequest.HttpResponse.OutputToDevice()The above is the code which i found in this link http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?…;
How do the above code works and can i be able to run this?
Thanks in advance.
I want to disable / turn off the visible cursor and then re-enable from with a Cache MUMPS (COS) routine.
Can anyone advise please ?
I am using the free Intersystems Cache installation (CachePCkit V2017.1) on Windows 10 for my own use & personal development.
Does anyone have a function they built to change a name from all lower case, or all upper case to mix case?
Thanks
Scott Roth
The base class Bmap.Person defines persons within an organization distributed
by various countries. All records are indexed by (Country, PersonalId).
this structure doesn't allow use of bitmaps.
So a wrapper class Bmap.PersonQ around the data eliminates the top level of
the index (Country) and isolates the PersonalId (%Integer, MINVAL=1).
We are ready to use a Bitmap index.
A few performance figures on 300010 generated records.
You see that Relative Cost are sometimes quite misleading.
base
select count(*) from Bmap.Intersytems documentation says not to hold entire SDA as object in In-memory.
Set object = ##class(User.NewClass1).%New()
s object.Property1="one"
s object.Property2="two"
s object.Property3="three"
s object.Property4="four"
Set w=##class(%XML.Writer).%New()
set w.Charset="UTF-8"
Set w.Indent=1
set status=w.OutputToString()
set status=w.StartDocument()
Set status=w.