Skip to main content


We've used the term “global” a few times already, without fully explaining it; we've only stated that it's used to store strings on disk. Here's a summary of the different kinds of globals and variables:

Term Meaning Scope Example
Global A persistent array, in an InterSystems IRIS database on disk All processes that have access to the database, and all code in those processes, can access this global. ^A
Process Private Global A temporary persistent array for a process, on disk (only if necessary) Even though this is called a global, only code that runs in the process that created it can access it. When the process stops, the global is deleted. It behaves like a public array that can grow in size beyond the limits of process memory. ^||A
Private variable A variable for a process Only the class method that created the variable can access it. A
Public variable A variable for a process Any class methods that declare the variable as public can access this variable. A

It's very easy to learn about globals in ObjectScript. Everything you just learned about arrays applies to globals. You don't have to declare them. When you're ready to store something on disk, just use Set statements, and you'll build a tree like the one you saw in the animation. Space on disk is only used when it's needed. Kill removes a node of a global (along with its descendants) or an entire global from disk, immediately. Nearly all the functions and commands that you've learned about using regular variables work on globals in the exact same way. The only difference is the use of the ^ (caret) or ^|| character(s) before the global name.

FeedbackOpens in a new window