What is the current preferred method for listing globals in a namespace?

I used to look at the source for% G, but recently Intersystems has stopped distributing .INT code. I suppose that in theory I could use the eXecute statement in a loop to check $ D for every legal global name, but this is stupid and unreasonably slow.

So what is the currently correct way to do this?

+4
source share
2 answers

use the special global variable ^ $ GLOBAL

eg:

s global="" f { s global=$o(^$G(global)) q:global="" zw global } 
+2
source

You can always use the class query in % SYS.GlobalQuery.

+6
source

Source: https://habr.com/ru/post/1402515/


All Articles