In your code above, you never assign any text to the variable "GVar_Info", so obviously you can't get any Global Terminal Variable for it, and hence the wrong/damaged string parameter.
ERR_WRONG_STRING_PARAMETER
5040
Damaged parameter of string type
![Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors](https://c.mql5.com/36/58/documentation-on-mql5-constants__10.png)
- www.mql5.com
In your code above, you never assign any text to the variable "GVar_Info", so obviously you can't get any Global Terminal Variable for it, and hence the wrong/damaged string parameter.
Hi Fernando,
Thanks for your helping soon. I has seen the guide that you showed. But my problem is i don't know the right function to get the global variable in MQL5. In my code, what is wrong? i can't find it. Please tell me the right code in the GlobalVariableSet and GlobalVariableget functions
I've already answered that in your code you don't assign any value to "GVar_Info". It is empty. How do you expect to find something that is unknown?
string GVar_Info = "Give_it_a_name"; // Give the global variable a name
I've already answered that in your code you don't assign any value to "GVar_Info". It is empty. How do you expect to find something that is unknown?
Hi Fernando,
Thank you so much, finally i got it.
That only is don't have the name, but it took me 1 week.
Thanks so much again for your supported.
Best Regards,
Tran Le
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello every one,
I have a error in MQL5 and i would like to get the helpful.
I make the code to save the global variable in MQL5 and it have an error #5040 by the function GetLastError(). In MQL4 i don't have any problem.
This is the code:
I don't know why this function have the problem. Please help me how can i set the global variable in MQL5?
Thank you.
Regards,
Tran Le