Globals

Syndicate content 10 

Let's imagine I have a global like this:

^Users(12, "SETTINGS", "IsAllowed") = 1

^Users(41, "SETTINGS", "IsAllowed") = 0

^Users(52, "SETTINGS", "IsAllowed") = 1

Now I would like to check for each user whether they are allowed, therefore I'd need to iterate through the Global. How to do that? It seems that I can't use $Order here like such:

S FF = ""
For {
 S FF=$O(^Users(FF,"SETTINGS","isAllowed"))
 Q:$L(FF)
 W "User ",FF," is allowed",!
}

Is there any other way of doing this? 

Last answer 25 August 2016
0   0 1
0

comments

287

views

0

rating

Process-private Globals  can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:

  • add elements to a pool (ignoring duplicates)
  • check if an element exists in the pool

Here's the class:

Last comment 16 August 2016
+ 4   0 3
409

views

+ 4

rating

Order is a necessity for everyone, but not everyone understands it in the same way
(Fausto Cercignani)

Disclaimer: This article uses Russian language and Cyrillic alphabet as examples, but is relevant for anyone who uses Caché in a non-English locale.
Please note that this article refers mostly to NLS collations, which are different than SQL collations. SQL collations (such as SQLUPPER, SQLSTRING, EXACT which means no collation, TRUNCATE, etc.) are actual functions that are explicitly applied to some values, and whose results are sometimes explicitly stored in the global subscripts. When stored in subscripts, these values would naturally follow the NLS collation in effect (“SQL and NLS Collations”).

Last comment 10 June 2016
+ 9   0 0
1625

views

+ 9

rating

Hi everyone!

     I am trying to choose the best collation for a new application that will be running on a spanish locale (Chile).

     I can see there are database collations for Spanish1, Spanish2, Spanish4 and Spanish5. What is the difference between them? I can't find anything on our documentation. Should I simply choose the latest (Spanish5)?

Kind regards,

Amir Samary

Last answer 24 May 2016
0   0 1
0

comments

150

views

0

rating

We are trying to create a simple class extending %RegisteredObject that could be used as a singleton. However we are not able to store it in a global to later be retrieved (by the same process but elsewhere in the code).

I resumed my issue in this small code sample : 

Last answer 19 April 2016 Last comment 20 April 2016
+ 1   0 1
348

views

+ 1

rating

If you are waiting for the Kindle Edition of Caché and MUMPS – Part II, I must apologize. I believed what others told me that once I have a book manuscript, the Kindle manuscript will be easy. Being a programmer I should have remembered: "never assume anything." The conversion to Kindle is proving a much bigger task than I thought. But don't lose heart, I am working full time on it. I have as my goal before May 1st. But, then again, you know what they say about goals. ;) - - Paul Mike Kadow

+ 1   0 1
0

comments

209

views

+ 1

rating

Is the default language (i.e., $$$DefaultLanguage, which is used as the basis for localization with $$$Text/etc. at compile time) always "en" for new Caché installations, or could it be different? How is this determined? I don't see an option to select a language during Caché installation.

Also, is there a supported/preferred API for setting the default language? Looking at %occMessages.inc, one option would be:

Last comment 2 March 2016
0   0 4
0

answers

187

views

0

rating