Martin Fukátko · Nov 7, 2022 go to post

This solution will work because global variable is visible on all stack levels (local variable is not).

But you'd use process private global varialble ^||pasp("unitcode") instead of  ^pasp("unitCode") which is visible from all processes and you can have collisons in multi user environment.

Martin Fukátko · Feb 18, 2022 go to post

What about this one:

 ClassMethod Indirection() [ ProcedureBlock = 0 ]
{
 (evenTotal)
 set TABLES(0)="EVEN" 
 set TABLES(1)="ODD"
 
 for i=1:1:100 {
   set table = TABLES((i#2)) 
   set @(table_"("_i_")")=i
   
   // Xecute alternative, same issue 
   ; set cmd = "set "_table_"("_i_")="_i 
   ; x cmd 
 }  set evenTotal=0
 set i="" for set i=$ORDER(EVEN(i)) QUIT:i=""  
   set evenTotal = evenTotal+EVEN(i) 
 
 zwrite evenTotal
}
Martin Fukátko · Nov 29, 2021 go to post

Thank you @Yuji Ohata You seem to be right. In the meantime, I managed to start Language Server as follows:
VScode runs smoothly on my second computer, so I looked for differences. I have Caché installed on the second computer, Iris on the troubled one. The problem disappeared when I installed Caché on the troubled one.

Martin Fukátko · Jan 21, 2021 go to post

When I have no "yellow box" during debugging MAC or CLS code in Cache studio I switch studio to INT code by CTRL + Shift + V

Or by mouse click View / View Other Code

Then press F11 and "yellow box" is here.

Martin Fukátko · Jan 20, 2021 go to post

I'll work around it by switching the studio to INT code tracing. 

Keyboard shortcut CTRL + Shift + v

Martin Fukátko · Oct 19, 2020 go to post

You can use ReplaceAll method if we have RegEx.

 set a="<Name>ABC</Name><RollNo>45</RollNo><Name>XYZ</Name><RollNo>66</RollNo><Name>xyz</Name><RollNo>89</RollNo>"
 set matcher = ##class(%Regex.Matcher).%New("(?i)(<rollno>)([^<]+)",a)
 write matcher.ReplaceAll("$1***")
<Name>ABC</Name><RollNo>***</RollNo><Name>XYZ</Name><RollNo>***</RollNo><Name>xyz</Name><RollNo>***</RollNo>
Martin Fukátko · Aug 25, 2020 go to post

Nice done Dmitriy! 

I hardened your inc routine a bit so as not to change the variables in the mac routine:

ROUTINE menu [Type=INC]

 #Execute set menuLineNum=0
  do myMenu()
myMenu(){
    Set menu = $$^menu($zname)
    Write !,"--------Menu---------"
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    write ##Expression($$asLine^menu(menu,$Increment(menuLineNum)))
    Write !!
    do {
      Write $Char(13),"Option? ",*27,"[0K"
      Read menuOption
      Quit:menuOption=""
      Quit:"qQ"[$Extract(menuOption)
      Quit:$Listget(menu,+menuOption)'=""
    while 1
    Write !
    if (+menuOption) {
      Set label = $Listget($Listget(menu, menuOption))
      Do @label
    }
  }
Martin Fukátko · Jul 17, 2020 go to post

DBearver works. Here are settings for Cahé on locathost with  superport=1972 and namespace SAMPLES.

Martin

Martin Fukátko · Dec 14, 2018 go to post

Groran, to make sure that problem is the connection timeout you can test the SQL in terminal. Terminal connection doesn't have timeout. and you can see how much it costs. Here is example from documentation:

SAMPLES>SET result=$SYSTEM.SQL.Execute("SELECT TOP 5 name,dob,ssn FROM Sample.Person")

SAMPLES>DO result.%Display()
Martin Fukátko · Aug 25, 2017 go to post

When you can't use ^%NOJRN (e.g. mirrored database)  you can let 2nd process to move log data from CACHETEMP to production database. Let start 2nd process during Caché start and let test it every 0.1 second if log data in CACHETEMP exists.  

Martin Fukátko · Aug 12, 2016 go to post

basic.csp  could show the way how to do it.
You can star it directly from Studio.

Martin