MQL4 Reference
Basics
Variables
Global variables
|
Global variables are defined at the same level as functions, i.e. they are not local in any block.
Example:
int GlobalFlag=10; // global variable
int start()
{
...
}
Scope of global variables is the entire program. Global variables are accessible from all functions
defined in the program. They are initialized with zero if no other initial value is explicitly defined. A global
variable can be initialized only by a constant that corresponds with its type. Global variables can be initialized
only once after program loading into client terminal memory.
Note: Variables declared at global level must not be mixed up with the Client Terminal global variables
that can be accessed unsing the GlobalVariable...() functions.
|
|
|