Questions about MQL4. - page 2

 
komposter, well, help me out.
Answer the original question.
I'm having some miracles over here...
 
Are you talking about the message box?
I mean, check it out for yourself?
 
Yes. Or somehow.
I'm coming to the conclusion that a CF hanging for a while before the button is pressed does not allow the EA to be connected later.
Put any MB in deinit, load and unload EA.
1. If you answer OK quickly, it remains possible to reconnect the EA.
2. If you wait a while, the EA will not join.

I almost lost my mind when I understood it...
 
have you tried reading the logs? =))))
I told you in the first post - deinit runs for 2.5 seconds.
The box delays the process, and the EA is forcibly shut down. After that it does not work (it just found out)
By the way, it works in the script ;)
 
You see, the thing is...
Let it work as long as you like, but why (or why) do we need the difficulty of connecting the next EA afterwards?

Is it supposed to be like this, or is it a flaw? Maybe the developers can tell us...
 
Maybe the developers will tell us.
.. maybe they will =)
but so far they rarely (or little?) read this forum...
 
komposter:
deinit runs for 2.5 seconds - should the user respond that quickly? =)
You can write to a file what needs to be done, and then the script will read it, display MessageBox and, depending on the response, do something about it.
as a rule, if the script is not looped endlessly, its deinit may run for a long time. the reason is, that if the script is not externally extinguished, there is nobody to control timeout. the script deinit naturally occurs immediately after the start function is executed. but for expert deinit to work, the EA should be extinguished first by one of 6 ways
 
stringo,
if the script is not looped indefinitely, its deinit may work for a very long time.
I don't really get it. What does looping have to do with deinit duration?
 
SKif:
stringo,
if the script is not looped indefinitely, its deinit can work for a very long time.
I don't really get it. What does looping have to do with the duration of deinit?
if the script has an infinite loop - it will run until it is disabled (then the deinit will be limited to 2.5 sec), and if not - it will work the start first and then deinit (if any) and deinit will run as long as you want
 
SKif:
I don't really get it. What does looping have to do with deinit durations?
it is very simple. an infinitely looped script does not terminate itself. it can only be externally extinguished (delete the script explicitly, hang a new script, change the chart symbol/timeframe, close the chart, close the terminal). when the command to close the script (and the EA too) is passed, the 2.5 second wait is set immediately thereafter. If the script (or expert) is so "stupid" that it does not check IsStopped, then, after 2 and a half seconds it is set a stop flag, which is checked automatically after each iteration of the loop and after each call of any function.
If the script completes its work, then it runs deinit and no one is watching it from above and no timeout is checked