Language basics / Globals |
Normally a globals file should only contain a GLOBALS ... END GLOBALS block. However, because the GLOBALS block can also be defined in regular modules, it is possible to include a source containing more than a GLOBALS block. When including such module, the sections before and after the GLOBALS block are ignored by the compiler. The source defining the global elements can be compiled individually.
For example, it is legal to define a module A with a GLOBALS ... END GLOBALS block, followed by function definitions. This module can be compiled and functions will be taken into account. Module A can then be included in module B with a GLOBALS "filename" instruction, and when compiling module B the function definitions of the included module A will be ignored. IMPORT instructions before the a GLOBALS ... END GLOBALS block will also be ignored in such case.