MQL4 Reference
Global variables
GlobalVariableSet
| datetime GlobalVariableSet( |
string name, double value) |
Sets a new value of the global variable. If it does not exist, the system creates a new gloabl variable.
If the function succeeds, the returned value will be the last access time. Otherwise, the returned value will be 0.
To get the detailed error information, one has to call the GetLastError() function.
Parameters:
| name |
- |
Global variable name. |
| value |
- |
The new numeric value. |
Sample:
//---- try to set new value
if(GlobalVariableSet("BarsTotal",Bars)==0)
return(false);
//---- continue processing
|
|
|