Exclude system globals
Hello everyone. I have some problem with selecting my own globals from namespace. My task is select only globals created by me. Follow my code, I get all globals from given namespace.
SET NAME="" F SET NAME=$ORDER(^$GLOBAL(NAME)) QUIT:NAME="" DO
Please help me with excluding system globals. I need work only with my own globals.
Discussion (2)0
Comments
You could use the %SYS.GlobalQuery NamespaceList query instead - there is a parameter to include/exclude system globals.
s rs=##class(%ResultSet).%New()
s rs.ClassName="%SYS.GlobalQuery"
s rs.QueryName="NameSpaceList"
s sc=rs.%Execute($namespace,"*",0)
Hi, Alexandr!
If you mean "System" as starting with "%" you can use the following:
SET NAME="" F SET NAME=$ORDER(^$GLOBAL(NAME)) QUIT:NAME="" DO:($E(Name)'="%")