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

Last answer 22 August 2018 Last comment 23 August 2018
0   0 5
183

views

0

rating

Hi,

I'm trying to find the faster way to get the data from a class, and I find it very slow compared to traditional globals. So, I hope some of you can bring some light to me :-)

I have thousands of registers in a class, and to access it quickly I'm going with $o at the index. From there, I get the values using $listget(). Something like that:

Last answer 7 August 2018 Last comment 9 August 2018
0   0 6
382

views

0

rating

Hello,

I have imported my data with the following code (%DocDB).

set filename = "/home/student/Dokumente/convertcsv.json"

IF $SYSTEM.DocDB.Exists("Fitabase1") { 

SET db = ##class(%DocDB.Database).%GetDatabase("Fitabase1")

}

ELSE {

SET db = ##class(%DocDB.Database).%CreateDatabase("Fitabase1") 

}

set arr = ##class(%DynamicAbstractObject).%FromJSON(filename)

SET jstring = arr.%ToJSON()

//SET doccount = db.%Size()

DO db.%FromJSON(jstring) 

Last answer 16 July 2018
0   0 2
0

comments

145

views

0

rating

Hi - has anyone successfully used the python binding on a mac. I carried out the install instructions per InterSystems documentation and it fails completely. 204 warnings and 9 errors. Obviously this was never tested by InterSystems. Is it even worth pursuing?

Thanks

Last answer 5 June 2018 Last comment 6 June 2018
0   0 3
242

views

0

rating

Hi all,

I am new in Cache. I have to update a record with a long text field, for that,  I am using ODBC but the issue is that it is returning an error when I execute the ODBC  SQL statement because the field contains some commas, colon, double quotes, single quotes, and CR LF characters.

There is a way to escape this chars? I have seen I can save the field when I replace the single quotes with a double single quote (it's -> it''s) but I can not save the information when the field contains double quote chars. What about the other chars?

Last answer 13 March 2018 Last comment 13 March 2018
0   0 3
398

views

0

rating

Hello,

I'm getting <WIDE CHAR> error in one of my routines, I was thinking a corrupted data  or disk out of space or no mount database but all seems to be OK?

I'm running Cache 2014.1.2 and the same routines and data works in our client main server with not problems but having the same copy in their backup server is generating <WIDE CHAR> error, some other reports works but this specific doesn't?

Thanks

Last answer 8 March 2018 Last comment 13 March 2018
0   0 3
157

views

0

rating

I needed to know programmatically if last ran failed or not.

After some exploring, here's the code:

ClassMethod isLastTestOk() As %Boolean
{
  set in = ##class(%UnitTest.Result.TestInstance).%OpenId(^UnitTest.Result)
  for i=1:1:in.TestSuites.Count() {
    #dim suite As %UnitTest.Result.TestSuite
    set suite = in.TestSuites.GetAt(i)
    return:suite.Status=0 $$$NO
  }
  quit $$$YES
}

Last comment 13 April 2019
+ 1   1 4
268

views

+ 1

rating