Hello, guys. 

I found one interesting moment in Cache Object Script. It doesn't have(or at least I didn't find) trimming function. By trimming I mean if a string has some whitespaces/tabs/carriage returns from very beginning or/and from very right, this function removes them. 

  I have found several workaround ways. 

1. Using Cache Basic

Last answer 9 September 2016 Last comment 30 September 2016
+ 1   0 1
614

views

+ 1

rating

I know that Cache files can be stored as XML and UDL based files. Is there any way to determine in which format the file(class, routine, dfi and so on) is stored? Because you can easily name your XML based file as class.cls and it will be perfectly valid. 

I know that one way to check whether this file is in XML format is just try to parse it like 

Set st = ##class(%XML.TextReader).ParseStream(contentStream)

if $$$ISERR(st) return $$$NO

else return $$$YES

However, is there a better way? 

Last answer 30 August 2016 Last comment 30 August 2016
+ 2   0 1
183

views

+ 2

rating

Hello, guys.

I have a set of file names (e.g. file.cls, file2.mac and so on) and I need to check whether these files are mapped in %ALL or current namespace.

I found that if I open Globals in the current namespace I can see mapped packages. And If I open this global I see all files that are  to this namespace and %SYS. The problem is these files are enumerated in a json object(apparently)

ex. "{""class"":{""%Activate.Enum"":{},""%Activate.GenericObject"":{""CreateObject"":0,""GetObject"":0},""%Activate.HandleEvents"")

Last answer 26 July 2016
+ 2   0 1
0

comments

151

views

+ 2

rating