Adapters in the same server or threads in a single process can share global variables. Global variables can be of type numeric, string or boolean.

Lists and tables can also be used as global variables but it is not recommended. The ASL programmer must exercise caution when using global lists or tables to ensure that a single thread or adapter is the "writer" of the list or table. If more than one thread or adapter attempts to assign values to a list or table, the likely result will be data loss due to rewriting the variables’ values. There is no inherent mutex or lock arrangement in ASL to prevent this and it is up to the programmer to ensure against this.

Global variable declarations must be made in the static section of the script file, before any rules are declared.

Note:

A local variable cannot have the same name as a global variable.

Adapters in the same server or threads in a single process can share global variables. Global variables can be of type numeric, string or boolean.

Use this syntax to declare a global variable:

global <variable_name>;