I should be way beyond this question by now, but I think it's important not only for me but also for other MT4 coders still learning coding/coding in MT4.
My question is regarding the use of return; in MT4
Example:
Where does return; return to in the above example? Does it go back to the beginning of the loop at: void Tranche1Buy() { here
and repeat void Tranche1Buy() ?
Or does it go out of the loop to the next level of {
Would this be more appropriate if I wanted it to go out of the loop and NOT repeat Tranche1Buy()
My question is regarding the use of return; in MT4
Example:
Inserted Code
void Tranche1Buy() { int result = OrderSend(Trade,OP_BUY,Lots,Ask,MaxSlippage,0,0,"Open LONG Tranche 1",Tranche1Buy,0,Cyan); Print("OPENED Buy Order Tranche 1", " # ", result, ", Open Trades: ", OrdersTotal()); if (result <= -1) { Print("ERROR WHILE TRYING TO OPEN Tranche 1 BUY ORDER! ERROR CODE # ", GetLastError()); } NewTrade == false; return; }
Where does return; return to in the above example? Does it go back to the beginning of the loop at: void Tranche1Buy() { here
and repeat void Tranche1Buy() ?
Or does it go out of the loop to the next level of {
Would this be more appropriate if I wanted it to go out of the loop and NOT repeat Tranche1Buy()
Inserted Code
void Tranche1Buy() { int result = OrderSend(Trade,OP_BUY,Lots,Ask,MaxSlippage,0,0,"Open LONG Tranche 1",Tranche1Buy,0,Cyan); Print("OPENED Buy Order Tranche 1", " # ", result, ", Open Trades: ", OrdersTotal()); if (result <= -1) { Print("ERROR WHILE TRYING TO OPEN Tranche 1 BUY ORDER! ERROR CODE # ", GetLastError()); } NewTrade == false; } return;