koranged: As there is no 'nearest following operator'
if (S>=S_etalon) // Choose the larger value { Alert("The thread length must be ",L/1000," m.");// Message break; // Exit the external cycle } } // End of the external cycle
Of course there is. It's the end of the while.
Of course there is. It's the end of the while.
You have cut out part of my sentence. My statement "As there is no 'nearest following operator' below the condition of the 'if' statement" is relevant as there is NO nearest following operator BELOW the condition of the 'if' statement.
So if as you say 'it's the end of the while.' then that is not BELOW the condition of the 'if' statement but rather ABOVE the condition of the 'if' statement.
I am effectively asking if control gets passed back up to the operator header, being that there is no following operator BELOW the line 'S>=S_etalon' (assuming that the condition is false.)
Can you help answer my question or do you wanna have a second go at being a smart arse?
- koranged: So if as you say 'it's the end of the while.' then that is not BELOW the condition of the 'if' statement but rather ABOVE the condition of the 'if' statement.
if (S>=S_etalon) // Choose the larger value <v Start of the IF { Alert("The thread length must be ",L/1000," m.");// Message break; // Exit the external cycle } <^ End of the IF vv Below the if. This is the next following. } // End of the external cycle << End of the WHILE is below end of the IF.
The next operation is the end of the while. - koranged: Can you help answer my question or do you wanna have a second go at being a smart arse?Do you really expect people to continue trying to help you with your rude remark? This question (and the other,) are so basic. You really have to learn how to code.
You have cut out part of my sentence. My statement "As there is no 'nearest following operator' below the condition of the 'if' statement" is relevant as there is NO nearest following operator BELOW the condition of the 'if' statement.
So if as you say 'it's the end of the while.' then that is not BELOW the condition of the 'if' statement but rather ABOVE the condition of the 'if' statement.
I am effectively asking if control gets passed back up to the operator header, being that there is no following operator BELOW the line 'S>=S_etalon' (assuming that the condition is false.)
Can you help answer my question or do you wanna have a second go at being a smart arse?
My questions are basic because I am an absolute beginner who is literally reading step by step through the manual to gain this information. I like to check the information I have learnt with the MQL4 community because there are people on here who know far more than me and can point me in the right direction if I have misinterpreted something.
Would it be possible for you to actually answer my initial question:
Where is control passed to next?
Are you saying it is passed back into the header of the 'while' operator as the first iteration of the cycle has been completed?
If so then that was what I asked in my very first message:
'But if the condition were to return as 'false', then control should be passed to the nearest following operator. As there is no 'nearest following operator' below the condition of the 'if' statement, should control therefore go straight back to the header of the 'while' loop because all the the possible calculations of this iteration have been completed, or somewhere else?'
Your response 'Of course there is. It's the end of the while.', does not answer the question 'where is control passed to next'. You simply picked out half a sentence and made a comment on it, without answering the actual question, which is why I called you 'smart arse'.
However I will offer you my apologies as regardless of the reason, calling you that was uncalled for so I am sorry.
Curly brackets are an operator, kind of. If I understand correctly control is passed to the last curly bracket which ends the loop and then to the while for another round..
Yeah that's how I see it too. I wasn't aware curly brackets are classed as an operator to be honest, but I suppose they are a formality. So once the closing curly bracket of the external cycle comes in I will assume that is the current iteration complete, and that control is sent back into the 'while' header for the next iteration.
It's in Documentation.
https://www.mql5.com/en/docs/basis/operators
- www.mql5.com
koranged:
Would it be possible for you to actually answer my initial question:
Where is control passed to next? Are you saying it is passed back into the header of the 'while' operator as the first iteration of the cycle has been completed?
- I did. "If the condition were to return as 'false', then control should be passed to the nearest following operator." Control goes to the bottom of the while loop. What happens next was not your initial question.
- Whether the while loop goes back to the top or exits, depends on the variable test of the while. Not your initial question.
- I did. "If the condition were to return as 'false', then control should be passed to the nearest following operator." Control goes to the bottom of the while loop. What happens next was not your initial question.
- Whether the while loop goes back to the top or exits, depends on the variable test of the while. Not your initial question.
1. Okay I didn't realise that a closing brace was classed as an operator so that is why I was misunderstanding you.
My question was 'where is control passed to next' and you were effectively saying control is passed to the closing brace of the 'while' operator, and then back into the 'while' header for next iteration (correct me if I'm wrong).
If that is the case then I offer you a further apology for my misunderstanding.
2. I did actually specify in the question - 'if the condition were to return as false'.
If the condition returns true then control obviously goes to the body of the 'if' operator.
So I was only asking where control would go to if the condition tested false.
- 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 everyone.
I am reading through the MQL4 manual step by step just trying to make sure I understand each section as much as possible before moving on.
I have some code here taken directly from page (https://book.mql4.com/operators/break) of the manual:
My question is regarding the line:
if (S>=S_etalon)
Of course if this condition returns as 'true', then control can be passed to the first line in the body of the 'if' operator.
But if the condition were to return as 'false', then control should be passed to the nearest following operator. As there is no 'nearest following operator' below the condition of the 'if' statement, should control therefore go straight back to the header of the 'while' loop because all the the possible calculations of this iteration have been completed, or somewhere else?
Help and advice much appreciated.
Thanks,
Ryan.