Features of the mql5 language, subtleties and tricks - page 152
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Is there one? Are you sure it's there? Which path is it on?
How can I reproduce it?
Place the script in the Navigator favourites.
Compile the wrong version.
Restart the Terminal and try editing the script from Favorites.
Developers. An explanation is needed. Which to believe? The docs or the implementation? So far undefined behavior appears.
@fxsaber, I do not recommend you to use it before the official explanations, maybe they will fix it.
Documentation is backlogged, let's fix it.
I do not recommend initializing static variables with expressions, if possible use a constant.
Because when you use a non-constant expression, the compiler generates the following code
There is an overhead, each call will check the __Implicit_myStaticVar_initialized flag
For the constant case, you will get the following code
There is no overhead.
Thank you, now I understand about the overhead.
Result
... The question is different. Perhaps there is a bug in MQL5, we need to deal with it, but postponing it to the topic for newbies doesn't help us figure it out soon enough.
Please read the title of the topic.
Please read the title of the thread.
And where do you see the contradiction? The situation described may be a feature of the language, or a bug. That is what you wanted to find out.
And where do you see the contradiction? The situation described could be a feature of the language, or it could be a bug. That is what you wanted to find out.
No. First it is found out whether it is a bug or a peculiarity - then it is posted exactly, and exclusively a peculiarity. The topic is only about features.
@Ilyas@Slava@Renat Fatkhullin
mql has support for undocumented keywords for functions
Is it reasonable to use them?
If yes, when will the compiler accept them?
In the ArrayReverse help:
TheArraySetAsSeries()function does not physically move the elements of the array, but only reverses the indexing direction backwards to arrange access to the elements as in atimeseries. The ArrayReverse() function physically moves array items so that the array is "reversed".
But this code proves the opposite: