Using Variables in Namespaces

Article number: KB000024

General Information

Related blocks:

Description

Code of a compilation unit (assembly, form, or unit) is created and compiled within the global namespace indicated in the development environment as Global Scope. Global namespace supports describing all types that can be described in a specific namespace.

If a namespace (specific or global) describes variables, on variables initialization their values are saved to the cache of the current repository connection. These variables can be used to exchange information between various assemblies, forms, or units connected by links. If all the variables store only simple type values, after code execution is completed the variables are cleared by the garbage collector. When custom class objects or links to open platform objects are stored in variables, the variables are not zeroed after the code is completed. This may result in memory leakage. To zero the variables described in namespaces, explicitly cast them to Null or use the Dispose statement.

See also:

Developers Knowledge Base