Skip to main content

Persistent Multidimensional Arrays (Globals)

Persistent Multidimensional Arrays (Globals)

A global is a sparse, multidimensional database array. A global is not different from any other type of array, with the exception that the global variable name starts with a caret (^). Data can be stored in a global with any number of subscripts; subscripts in InterSystems IRIS are typeless.

The following is an example of using a global. Once you set the global ^x, you can examine its value:

 SET ^x = 10
 WRITE "The value of ^x is: ", ^x,!
 SET ^x(2,3,5) = 17
 WRITE "The value of ^x(2,3,5) is: ", ^x(2,3,5)

For more information on globals, see Multidimensional Arrays and Using Globals.

FeedbackOpens in a new tab