You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I take this function from MQL5 Reference / Language Basics / Functions
But the compiler prints '(' - semicolon is expected
What does it mean?
I have checked it using the example from the edit (replacing the first passed parameter). everything is OK, no errors occured.
The correct help example looks like this
I could get such a message like yours personally only in one test, when I replaced the first curly bracket with a round one. Then I got this message
'(' - semicolon is expected
If the number of parentheses (right and left) does not match, the following warning is generated
';' - unexpected token
'}' - semicolon is expected
PS
If I try to compile the current example (with a Russian "a") the compiler generates an error like it should
'a' - undeclared identifier
Don't make up things for others that aren't there :) The symbol was fixed right away in the editor, as a matter of course. The error occurs when the cursor is in front of the opening parenthesis, not before the 'a' character. Being humanly attentive, you should have noticed it in the quoted compiler comment.
The question remains: https://www.mql5.com/ru/forum/1111/page304#comment_48136
Explanation. The question has arisen, not because I am sitting down and stupidly compiling examples from the reference book, but because this error message appears when I create a working function. Referencing the example from the reference does not change anything. You can even remove the description of arguments from the header - the problem persists.
Yes he has an error, most likely unrelated to this example....
You need to look at the whole code...
I take this function from MQL5 Reference / Language Basics / Functions
But the compiler prints '(' - semicolon is expected
What does it mean?
The letter in the example has been fixed, but that's the exact error we couldn't get. Can you provide the full code so we can reproduce?
Thank you all for your attention to the question! The thing is, there is no "complete code" that could initiate an error. I just decided to check the statement from a C++ textbook that the value of an external variable, which is passed to a function as an argument, cannot be changed by the function (or something like that - well, from the field of self-education). I created a primitive function to check - the compiler generates an error. I referred to the reference, copied the example, corrected the symbol in the example - still the same error. I have tried to insert the function into a script template and in the Expert Advisor template, the error does not change. In fact, the "complete code" consists only of the function from the example, which has been inserted in the empty body of the onTick() or onStart() function.
I'll post such pseudo-complete code in the evening, but I don't know if it helps. I'll also try to overload the computer, since it's been used in "go to sleep and back" mode for a week.
The letter in the example has been corrected, but it was not possible to get this exact error. Can you provide the full code so we can reproduce?
Somehow this is reproduced like this.
Well, you are trying to define one function within another - this is unacceptable. The function call section tells you this explicitly:
A function can be declared or described anywhere in the program globally, i.e., outside of other functions. A function cannot be declared or described within another function.
Well, you are trying to define one function within another - this is unacceptable. The function call section says this explicitly:
Thanks for the clarification! Exactly my case.
Theoretical knowledge does not guarantee the correctness of its application in practice :) My mistake.
Build 392.
When deleting a chart, it doesn't appear in the deleted list. It turns out that the File>Open Deleted menu item doesn't work.
Accidentally closed (instead of unfolding) the chart, hoping to see it in the deleted ones, and then ...
Build 392.
When deleting a chart, it doesn't appear in the deleted list. It turns out that the File>Open Deleted menu item doesn't work.
Accidentally closed (instead of unfolding) the chart, hoping to see it in the deleted ones, and then ...
Check the box.
Some agents won't start remotely, here's the log:
Although via localhost this agent works locally.
What could be the reason?