Can you tell me if break: (1) should be inside {..} or (2) should be after }, because in the switch statement example only one action is considered after case.
I was thinking about {...} in case by analogy with if. If there is more than 1 action, it should be {...}. If the philosophy of case operator is such that everything (!) is executed after it, then I feel we should remove {...}, like:
paladin80: I thought about {...} in case by analogy with if. If there is more than 1 action, you need {...}. If the philosophy of the case operator is such that everything (!) is executed after it, then I feel we should remove {...} altogether, like:
Everything is performed before the break, otherwise default.
i.e.
case1: b=Ask+SL_1*Point; c="with stop-loss = "+a; break;
или
case1: b=Ask+SL_1*Point; c="with stop-loss = "+a; return(09,05);
приемлема и работает.
{...} is implied from case to break (try output;)).
Can you tell me something: I am using several arrays in my calculations and I need to switch between arrays, but it is not very convenient to use constant condition before each use of the required array. Are there any reference variables in MT4 to check the condition once and then write in it which array I need to work, I haven't found it in documentation.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Tested and the result - opened 2 orders and didn't close on profit and didn't open any more.
So this option is not suitable.
So it goes back to my first post - "...incomplete TK".
Parentheses are not necessary at all. But if you do - then the break is inside.
Although... who the fuck cares, it still has to execute.
I thought about {...} in case by analogy with if. If there is more than 1 action, you need {...}. If the philosophy of the case operator is such that everything (!) is executed after it, then I feel we should remove {...} altogether, like:
Everything is performed before the break, otherwise default.
i.e.
{...} is implied from case to break (try output;)).
Yeah, and your code won't compile at all - because of this:
No, variables (and arrays too) can only be passed by reference to a function.