Manel Trèmols · Apr 20, 2018 go to post

Hi John,

You understood me well.

But it's curious, after to run a Template, the list is never populated. I see always "Template 1", nevertheless , my "Add in" menu is populated...

I have searched the name using regedit

Add list is there:

Equipo\HKEY_CURRENT_USER\Software\InterSystems\Cache Studio\Recent Add Ins List

I can see also "Recent Template List n" from 0 to 6

Equipo\HKEY_CURRENT_USER\Software\InterSystems\Cache Studio\Recent Template List n

If you have something there, can you tell me the format, please ?

I will try to add it into my register

Thanks

Manel

Manel Trèmols · Apr 20, 2018 go to post

Hi John,

I have 2017.2.0 Build 740

I tested also others Studio version with same luck

Yes, I have one document open. Template 1 is enabled but it does nothing.

I tested also to populate "Recent Template List 0" and 1 but it does the same 8-(

Manel Trèmols · Apr 23, 2018 go to post

Yes to all.

I open a new document, then I open the Template dialog:

   Then I select one Template an I run it: 

I select one option:

I poputate the question:

And I press End. I get the code, but if I come back to the menu, nothing is there:

Manel Trèmols · Feb 3, 2017 go to post

Hi,

You can do a routine for to do it, for example:

set rou=""for {  set rou=$o(^rMAC(rou)) quit:rou=""  write !,rou  set lines=^rMAC(rou,0,0)  for x=lines:-1:2 {    set ^rMAC(rou,0,x+1)=^rMAC(rou,0,x)  }  set ^rMAC(rou,0,2)=$c(9)_"#include %occInclude"  set ^rMAC(rou,0,0)=lines+1  set ^rMAC(rou,0)=$now()  do COMPILE^%RCOMPIL(rou,"MAC",.success)}

Regards

Manel

Manel Trèmols · Mar 27, 2018 go to post

Hi John,

I think you can do it using mnemonics:

write /SGR(1),"bold",/SGR(0)," normal"

Probably the printer will not understand this, but you can define another mnemonic for the printer, sending the correct escape sequence to it

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_intro#GIOD_intro_definemnemomic

and then use the |PRN| device with your mnemonic:

USE "|PRN|"::"^%PCL"

For example, if printer is PCL you should send:

%PCL
  quit
SGR(%1)
  if %1=1 write $c(27),"(s3" // Bold
  if %1=0 write $c(27),"(s0" // Normal
  quit
Manel Trèmols · Apr 3, 2018 go to post

Hi John,

My sample was using PCL but I don't know what printer are you using.

First thing should be to know what escape sequence do you need to send to the printer for to get bold.

Escape sequences are different if printer is HP, Epson, etc...

My suggestion is to check first doing an open printer, use printer, write escape sequence text, close printer if printer is doing bold.

After to get the correct escape sequence, you can write a mnemonic routine for to get bold in terminal, printer1, etc.. without change your code.

You will need different mnemonic routines for different printer types.

Hope this helps

Manel

Manel Trèmols · Jul 3, 2018 go to post

Another option is to use the open command where first argument is the OS command. Then you can get the answer from OS. For example:

 set old=$zu(68,40,1) ; Enable $zeof kill ^TMP($zn,$j) set cmd="find /logs/* -printf '%Td/%Tm/%TY %f\n'" open cmd:"Q" use cmd for x=1:1 read line quit:$zeof=-1 set ^TMP($zn,$j,"FILE",x)=line close cmd if $zu(68,40,old) // Restore previous mode

Regards

Manel

Manel Trèmols · Aug 1, 2019 go to post

Hi Rodolfo,

If I understand correctly your question, using Base64Decode, you will get it:

set tGZIP=$System.Encryption.Base64Encode("This is my original XML")write !,tGZIPset tXML=$System.Encryption.Base64Decode(tGZIP)write !,tXMLquit

Running this you get:

USER>d ^gzip
 
VGhpcyBpcyBteSBvcmlnaW5hbCBYTUw=
This is my original XML
Manel Trèmols · Jan 27, 2020 go to post

Hi Sagun,

I would check after Execute, the Vism property Error or ErrorName. If there is any error, you should see there.

Regards

Manel

Manel Trèmols · Apr 1, 2020 go to post
Hi Stuart

And using CONTINUE command ?

set list = "ABC~DEF~GHI~JKL~MNO~[~PQR~]"set SegmentList = $LISTFROMSTRING(list,"~")set SegmentCount = $LISTLENGTH(SegmentList)set OptionalSegment="N"FOR = 1:1:SegmentCount{  if $LISTGET(SegmentList,i)= "[" set OptionalSegment = "Y" continue  if $LISTGET(SegmentList,i)= "]" set OptionaSegment="N" continuewrite !, "Current Segment: "_$LISTGET(SegmentList,i)," ",OptionalSegment  ;set SegmentFields = $LISTFROMSTRING(object.SegmentSubStructure,"~")  ;set SegFieldCount = $LISTLENGTH(SegmentFields)}
Manel Trèmols · Apr 22, 2020 go to post

Hola Yone,

Not sure what version do you have, but if you look at EnsLib.SOAP.InboundAdapter .cls you will see when this error is raised.

In my version, basically it is doing, first line is "tLine" variable:

$p($p(tLine," ",3),"/",1)

If it's not "HTTP" then error is raised.

So, I will check what is in Raw tab:

Regards

Manel

Manel Trèmols · Nov 30, 2020 go to post

Hi José,

I think it's better to implements your own code... and more in this case, where you can "convert" arrays to globals or process-private globals and to solve any problem without worry about number of items...

Manel Trèmols · Aug 30, 2021 go to post

Another solution:

quine  for x=1:1:^ROUTINE($zn,0,0) write !,$g(^ROUTINE($zn,0,x))

USER>d ^quine
 
quine
        for x=1:1:^ROUTINE($zn,0,0) write !,$g(^ROUTINE($zn,0,x))
USER>
Manel Trèmols · Jan 25, 2023 go to post

Hi Edoeard,

Try adding parameter CHARSET:

/// Main TDF REST service entry pointClass TDF.Main Extends%CSP.REST
{

Parameter CHARSET = "UTF-8";

Regards

Manel

Manel Trèmols · Nov 8, 2023 go to post

Hi Jude,

Into the Designer folder, you should have a logs folder and inside a LogiReport.log file.

Can you check there if you have a more detailed error description ?

Thanks

Manel Trèmols · Apr 10, 2024 go to post

Similar to Robert solution but using for:

setx="1,4,6,8,9,12"forwrite !,+xsetx=$p(x,",",2,*) quit:x=""1468912
Manel Trèmols · Apr 16, 2024 go to post

Hi Michael,

Something like this ?

Search where "<?xml " starts

Search where it ends (first >)

Get first tag after xml header

Find where this tag ends

Remove characters in the middle.

test
	set complex=1set crlf=$c(13,10)
	set file="text 1"set file=file_crlf_"text 2"set file=file_crlf_"<?xml version=""1.0"" encoding='UTF-8'?>"if complex {
		set file=file_crlf_"<Results xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"set file=file_crlf_"     xmlns='urn:tcleDoctorReport'"set file=file_crlf_"         xsi:schemaLocation='urn:tcleDoctorReport DoctorReport.xsd'>"
	} else {
		set file=file_crlf_"<Results>"
	}
	
	set file=file_crlf_"	<ReportPageFormat/>"set file=file_crlf_"	<Department>"set file=file_crlf_"		<Section>"set file=file_crlf_"			<TestSet>"set file=file_crlf_"				<TestSetDesc>Blood Culture (Aerobic+Anaerobic)</TestSetDesc>"set file=file_crlf_"			</TestSet>"set file=file_crlf_"			<TestSet>"set file=file_crlf_"				<TestSetDesc>Blood Culture Positive Result</TestSetDesc>"set file=file_crlf_"			</TestSet>"set file=file_crlf_"		</Section>"set file=file_crlf_"	</Department>"set file=file_crlf_"	<EpisodeData>"set file=file_crlf_"		<EpisodeNumber>240000100</EpisodeNumber>"set file=file_crlf_"		<FirstName>Lily</FirstName>"set file=file_crlf_"	</EpisodeData>"set file=file_crlf_"</Results>"set file=file_crlf_"text 3"set file=file_crlf_"text 4"set xmlheadstart=$f(file,"<?xml ")-6set xmlheadend=$f(file,">",xmlheadstart)-1;zzdump $e(file,xmlheadstart,xmlheadend)set firsttag=$tr($p($e(file,xmlheadend+1,*),">",1)_">",$c(13,10))
	;zzdump firsttagset tag=$p($e($p(firsttag," ",1),2,*),">",1)
	;write !,tagset xmlend=$f(file,"</"_tag_">")
	
	zzdump$e(file,1,xmlheadstart-1)_$e(file,xmlend,*)

What I get:

USER>d^test20000: 7465787420310D0A 7465787420320D0A         text 1..text 2..
0010: 0D0A 7465787420330D0A 746578742034..text3..text 4
USER>

Regards

Manel

Manel Trèmols · May 9, 2024 go to post

Hi James, I'm sending same exercise with asteroids 😂

novice
    do {
        for  {
            read !,"Enter time HH:MM:SS :",hr#2if hr=""quitread":",min#2,":",sec#2if hr '?2n!(hr >23) write !,"hr  must be a number between 0 and 23"continueif min'?2n!(min>59) write !,"min must be a number between 0 and 59"continueif sec'?2n!(sec>59) write !,"sec must be a number between 0 and 59"continuequit
        }
        if$l(hr) {
            write !,"Equivalent M time: ",$$ConvertToMTime(hr,min,sec)
            write" ",$zth(hr_":"_min_":"_sec)
        }
    } while$l(hr)
    quit

ConvertToMTime(h,m,s)
    quit (h*3600)+(m*60)+s
Manel Trèmols · Jun 12, 2024 go to post

Hi Steven,

You can user the CONCAT function

select OEORI_Date, OEORI_TimeOrd, OEORI_UpdateDate, OEORI_UpdateTime, DATEDIFF('n',{fn CONCAT({fn CONCAT(OEORI_Date,',')},OEORI_TimeOrd)},{fn CONCAT({fn CONCAT(OEORI_UpdateDate,',')},OEORI_UpdateTime)}) from SQLUser.OE_orditem
Manel Trèmols · Jul 18, 2024 go to post

I guess script getting wrong time has a set $ztimezone=5 or -5 somewhere, this will change $horolog only for this process

Manel Trèmols · Sep 3, 2024 go to post

Hi Richard,

Parameter 1 is namespace where routine1 is.

Parameter 2 is routine1 name

Parameter 3 is namespace where routine2 is.

Parameter 4 is routine2 name

Parameter 5 is global where differences are saved.

If you want to compare same routine in different servers, you should use ECP for to see the other namespace.

Syntax for to call it:

USER>do##class(%Library.Routine).RoutineCompare("USER","routine","TEST","routine","^x")
 
USER>d^%GFor help on global specifications DO HELP^%G
Global ^x^x(1)=$lb("","","+372",$c(9)_"; New comment")

I think it would be better to have a small front-end that connects to a server1 and export routine1, connets to server 2 for to get routine2 and then compare both text file using any compare program like Beyond Compare 4

Regards

Manel