Hi,
I am looking for a function in a script that opens a window with some information (that I pass as a string) and has to buttons to select "OK" and "Cancel". If "Cancle" is chosen, I would like to exit the script.
Thank you.
Best,
Chris
- www.mql5.com
OK, that's what I was looking for. If "Cancle" is clicked, I would like to immediately exit the script. Is there a function for that?
OK, that's what I was looking for. If "Cancle" is clicked, I would like to immediately exit the script. Is there a function for that?
You only have to check the returned code and use the return statement from OnStart() function, something like :
void OnStart() { ... int result= MessageBox("Message...",...); if(result == IDCANCEL) return; ... }
You only have to check the returned code and use the return statement from OnStart() function, something like :
This would be one feasable solution if I would invoke the function with MessageBox within OnStart(). However, I invoke MessageBox deeply embedded in my code, like OnStart()=>FunctionA()=>FunctionB()=>MessageBox(). So I had to pass the return code from MessageBox to FunctionA an from FunctionA to OnStart().
What I am looking for is a function that immediately exits the script where I don't need to "jump back" to OnStart(). Is there such a function?
This would be one feasable solution if I would invoke the function with MessageBox within OnStart(). However, I invoke MessageBox deeply embedded in my code, like OnStart()=>FunctionA()=>FunctionB()=>MessageBox(). So I had to pass the return code from MessageBox to FunctionA an from FunctionA to OnStart().
What I am looking for is a function that immediately exits the script where I don't need to "jump back" to OnStart(). Is there such a function?
What do you mean using term "script"? See difference between "script" and "expert advisor" https://www.mql5.com/en/docs/runtime
Try ExpertRemove
What do you mean using term "script"? See difference between "script" and "expert advisor" https://www.mql5.com/en/docs/runtime
Try ExpertRemo
What do you mean using term "script"? See difference between "script" and "expert advisor" https://www.mql5.com/en/docs/runtime
Try ExpertRemove
I am programming a script to set an order. So this is not an EA. While placing the order I want to exit the script when some comditions are not met.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I am looking for a function in a script that opens a window with some information (that I pass as a string) and has to buttons to select "OK" and "Cancel". If "Cancle" is chosen, I would like to exit the script.
Thank you.
Best,
Chris