go to post Robert Cemper · Aug 30, 2017 The ouput goes to port 4200. That works with Caché. (see test code)Attention: The ! at the end of the WRITE is important as it triggers the send.in SAMPLES it is at the beginning: So you just get an empty line. and rest remains in buffer.You may also add WRITE !! before the CLOSE to flush the buffer and send an empty line for termination .I have no knowledge on Python or PythonConsole but from your code I see no indicationwhere it starts listening at port 4200. pls. check.Test code from Caché Terminal:USER>set tcp="|TCP|4200"USER>open tcp:(:4200):1 write $s($t:"OK",1:"failed"),!OKUSER>for line=1:1 use tcp read text use 0 write line,?5,text,!1 Name: Uhles,Rob O.<READ> [ <READ> is the reaction to the connection CLOSE of the sender as I don't check termination ]
go to post Robert Cemper · Aug 29, 2017 Sorry, I saw just that one Print method fromSAMPLES.The redirect is especially required to convert a Write Command to a Write() Method and vice versa.For "classic" devices as files , TCP, UDP, all kind of pipes ,SPOOL,Console, Teerminal,...all you find in Caché I/O Device Guide I just see no added value except fiddling around $P which I never had the need to do over 40yrs
go to post Robert Cemper · Aug 29, 2017 Method PrintPerson() { set tcp="|TCP|4200" open tcp:("127.0.0.1":4200:"PSTE"):1 else quit use tcp Write "Name: ", ..Name,! close tcp Quit }
go to post Robert Cemper · Aug 29, 2017 you insert the object to itself ????do context.MainObj.IssuesList.Insert(context.MainObj)really ? does this make sense ??I woldd expected something like:do context.MainObj.IssuesList.Insert( tmpObj )ordo context.MainObj.IssuesList.Insert(context.tempZenObj )
go to post Robert Cemper · Aug 29, 2017 The parameters are defined all over here: Searching for 'SERVICEINPUTCLASS' in 'Ens*.cls' (whole words,case sensitive) Ens.Enterprise.MsgBank.BankTCPAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS Ens.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.DICOM.Adapter.TCP.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.EMail.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.File.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.HTTP.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.Pipe.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.SQL.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.TCP.CountedInboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.TCP.DuplexAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.TCP.FramedInboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.TCP.TextLineInboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS EnsLib.UDP.InboundAdapter.cls(SERVICEINPUTCLASS): Parameter SERVICEINPUTCLASS Found 13 occurrence/s in 13 file/s. Searching for 'SERVICEOUTPUTCLASS' in 'Ens*.cls' (whole words,case sensitive) Ens.Enterprise.MsgBank.BankTCPAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS Ens.InboundAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS EnsLib.DICOM.Adapter.TCP.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS EnsLib.HTTP.InboundAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS EnsLib.TCP.CountedInboundAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS EnsLib.TCP.FramedInboundAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS EnsLib.TCP.TextLineInboundAdapter.cls(SERVICEOUTPUTCLASS): Parameter SERVICEOUTPUTCLASS Found 7 occurrence/s in 7 file/s. But there is no case where it is used. Looks like "reserved for future use "
go to post Robert Cemper · Aug 29, 2017 The diagramm shows to me 2 object REFERENCES (oref)oref consists of a (local) integer@Classname and points to an object.in your case both are of type %Collection.ListOfObj by the reference you can't tell that this is the same.any ##class(%Collection.ListOfObj).%New() will create a new orefin your case I see a count of 1 and then a count of 2 you should look what happens in or after (19) and in or after (29)looks to me like a fresh return value
go to post Robert Cemper · Aug 28, 2017 COS shorthand is hard to read in browser;I personally prefer full size COS + Courier as font.
go to post Robert Cemper · Aug 28, 2017 set CountRow=pObject.IssuesList.GetAt(i).Count() you assume pObject.IssuesList.GetAt(i) gives back a %Collection Object (Iist, Array, ..)Before applying method .Count() you should check if this assumption is true.your previous description with ASSIGN / APPEND wasn't that convincing that you always have the object you expect. ref: "out of the scope of ENSEMBLE to an external class" you should save anything that you want to keep over that call in one/multiple property of %context Object.
go to post Robert Cemper · Aug 28, 2017 you missed the $TRANSLATE(.....," ",0) aroundpls. set the hook to your preferred solution
go to post Robert Cemper · Aug 28, 2017 $EXCTRACT() and also $LI(), $Piece()is not allowed at the left side of SET when the target is an object propertyuse an intermediate variable instead.e.g.set tmp="0000000000"set $EXTRACT(tmp,10-len(context.PatientID)) = context.PatientIDset context.NewID=tmpit might be easier that wayset context.NewID=$EXTRACT("0000000000"_context.PatientID,*-9,*)
go to post Robert Cemper · Aug 28, 2017 Thank you Heikki,I have passed this "cooling" too and missed the "heat." So my mind is back and the body stays at home
go to post Robert Cemper · Aug 26, 2017 Hi Lexi,if you prefer to work unplugged you also may use HAMSTER (it's bilingual DE/EN)http://www.elbiah.de/hamster/pg/*
go to post Robert Cemper · Aug 24, 2017 Did it work ? %GCMPCompares two globals in the same or different namespace.
go to post Robert Cemper · Aug 24, 2017 Looks like running the query but not getting a resultset.You seem to be reading past the last row you got.Hardcore fix, if noting better. Wrap it in Try { } Catch {} /// it's not my favourite
go to post Robert Cemper · Aug 24, 2017 by lack of responses I converted it from a question to an article + comment
go to post Robert Cemper · Aug 24, 2017 Then that's the curse of $PIECE() with no chance to fake it.So name the separator # ' " . / \ ~ ^ ...anything but ,[ as Johnny Cash was singing: ... anything but "Sue" ]
go to post Robert Cemper · Aug 24, 2017 I did a short test fiddling arouned ^Samples.PersonIan to demonstrate the output.SAMPLES>Do $SYSTEM.OBJ.ValidateIndices("Sample.Person","",1,2) Checking index integrity for class 'Sample.Person'Begin time: 08/17/2017 21:41:25 Verifying data from data map 'IDKEY' is indexed correctly...Index 'NameIDX', entry ^Sample.PersonI("NameIDX"," CHANG,QUIGLEY H.",39), has differences between master map data and index map data. CorrectedIndex 'NameIDX', entry ^Sample.PersonI("NameIDX"," CHANG,DAN L.",40) missing. CorrectedIndex 'NameIDX', entry ^Sample.PersonI("NameIDX"," CHADWICK,OLGA E.",43) missing. CorrectedIndex 'NameIDX', entry ^Sample.PersonI("NameIDX"," CANNON,BARBARA W.",81) missing. CorrectedData Map evaluation complete, 200 rows checked, 4 errors found, elapsed time: .004733 seconds Verifying data from index map "$Person" is correct...Index map "$Person" evaluation complete, 0 errors, elapsed time: .000691 seconds Verifying data from index map NameIDX is correct...Index 'NameIDX', entry ^Sample.PersonI("NameIDX"," CEMPER,DAN L.",40), data differs for field 'Name' between data and index map. CorrectedIndex map NameIDX evaluation complete, 1 errors, elapsed time: .001331 seconds Verifying data from index map SSNKey is correct...Index map SSNKey evaluation complete, 0 errors, elapsed time: .001195 seconds Verifying data from index map ZipCode is correct...Index map ZipCode evaluation complete, 0 errors, elapsed time: .001255 seconds %ValidateIndices is complete, total elapsed time: .012282 seconds SAMPLES> This looks good so far.
go to post Robert Cemper · Aug 23, 2017 start hereit might not be as trivial as you thinkhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...more...HTH