Want to share with you code snippet of try catch block I usually use in methods which should return %Status.

 try {
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()

Quit sc 

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

4 21
1 2,570

Hi all,

I've been looking for a way to extract the sorting from the ^CacheTemp.zenData global that contain the tablePane snapshot data in order to use it on a report following the current UI sorting criteria.

I could see that if the column is sorted by one column, new entries with this structure are created:


0 6
0 442


For debugging purposes I sometimes need to display stack information to the current device or save it (to a global for example).

There is this snippet offered in documentation:

ClassMethod StackToDisplay()
    For loop = 0:1:$Stack(-1) {
        Write !, "Context level:", loop, ?25, "Context type: ", $Stack(loop)
        Write !, ?5, "Current place: ", $Stack(loop, "PLACE")
        Write !, ?5, "Current source: ", $Stack(loop, "MCODE")
        Write !

And to save stack to a global there's always an exception method:

0 11
0 1,168

There have been a few use cases recently within InterSystems where we've needed to connect to Caché-based web services from PHP. The first of these was actually the Developer Community itself, which uses web services as part of Single Sign-On with other InterSystems sites/applications. The following example demonstrates how to connect to a Caché-based web service (particularly, the web service in the SAMPLES namespace) from PHP, using password authentication.

5 0
0 2,380

RESTful API Call From Cache to Particle.io Electron

Tom Fitzgibbon | Multidata | 212-967-6700 x537 | tom@mul.com

Summary: Simple Blink Tutorial for Particle.io Electron Device from Cache

Electron device is a tiny ARM processor ($40-$60) that connects to Particle’s world wide leased 2G/3G network (about $3/mo) and runs off an included LiPo battery. Using Cache’s %Net.HttpRequest you can send/receive data, control hardware and read sensors.

Step by Step (about 1 hour)

1) Get the Electron from store.particle.io.

2 0
0 1,118

C:\data\backup.bat :

C:\InterSystems\Ensemble\bin\cache -s"C:\InterSystems\Ensemble\Mgr" -U%%SYS ##Class(Backup.General).ExternalFreeze() <C:\data\login.scr


rem note that we need to check errorlevel from highest to lowest here....

if errorlevel 5 goto OK

2 0
0 1,604

The attached file contains an example of code generation using ObjectGenerators which builds a very simple homemade RuleEngine.

Code generation is an excellent way of increasing performance moving run-time calculations to compile-time.

We could generate code creating routines or implemeting methods using ObjectGenerators. In this example we are using ObjectGenerators.

Update: Rule Engine is now on GitHub https://github.com/intersystems-ib/cache-iat-ruleengine

4 0
0 704
Brendan Bannon · Nov 9, 2015 1m read
Cache SQL Storage Mapping

The attached zip file contains a bunch of examples of Cache SQL Storage mappings that I have done over the years.

If you have existing globals and want to expose them via Objects or SQL you need to setup Cache SQL Storage mapping. If you do not see an example that helps with your case send me an example and I can help you out.

2 0
0 894
Daniel Kutac · Nov 9, 2015 3m read
Tipy a Triky s Caché

Tip dvacátý šestý: objekty a concurrency 2 - swizzling

Když tento seriál před několika lety začínal, byl jeho první díl věnován zajištění izolace instance objektů pro exkluzivní přístup a popisu příslušných API funkcí. Nedávno se mi ale stalo, že mě tento díl dostihl. Jeden ze zákazníků začal mít problémy v aplikaci, přestože důsledně používal exkluzivní zámky pro editování instancí svých objektů.

0 0
0 259