GLOBAL Define global symbol Directive
GLOBAL definition [, definition ]...
Acts as a combination of the EXTRN and PUBLIC directives to define a
global symbol. definition describes the symbol and has the following
format:
[language] name [[count1]] :complex_type [:count2]
- language specifies that the naming conventions of C, CPP, PASCAL,
BASIC, FORTRAN, NOLANGUAGE, or PROLOG are to be applied to symbol
name; temporarily overrides language set with a MODEL directive.
- If name is defined in the current source file, it is made public
exactly as if used in a PUBLIC directive. If not, it is declared as
an external symbol of type complex_type, as if the EXTRN directive
had been used.
- name can be followed by an optional array count multiplier, count1,
which defaults to one
- complex_type must match the type of the symbol in the module where
it is defined (the ABS type is used for symbols that represent
absolute numbers)
- count2 specifies how many items this symbol defines (one is the
default).
The GLOBAL directive lets you have an include file included by all
source files; the include file contains all shared data defined as
global symbols. When you reference these data items in each module,
the GLOBAL definition acts as an EXTRN directive, describing how the
data is defined in another module. In the module in which you define
the data item, the GLOBAL definition acts as a PUBLIC directive,
making the data available to the other modules.
You must define a symbol GLOBAL before you first use it elsewhere in a
source file.
Examples: GLOBAL uncap_al :proc
GLOBAL str_len :abs
GLOBAL C carray[32]:word:400
GLOBAL help_texts :byte:panic_levels