MQL4 Reference Language Basics Variables Extern Variables
Extern variablesThe extern storage class defines the external variable. The extern modifier is indicated before the data type.
Similar to input-variables, extern ones also determine the input parameters of an mql4 program. They are available from the Properties window. Unlike input variables, values of extern variables can be modified in the program during its operation. External variables are always reinitialized immediately before the OnInit() is called. Example:
Strict compilation mode with the output of the input parameters window is set in this script. Therefore, the values set in the string comments instead of ExtVar and InpVar variable names are displayed in Variable field. Note: Arrays and variables of complex types can't act as extern variables. Note: The length of a string comment for extern variables cannot exceed 63 characters. See also Input Variables, Data Types, Encapsulation and Extensibility of Types, Initialization of Variables, Visibility Scope and Lifetime of Variables, Creating and Deleting Objects |