Beta version of the online book on MQL4 programming - by Sergey Kovalev (SK.) - page 6

 
Rosh:
Martes:

On two different computers and with different browsers, the pictures on https://book.mql4.com/ru/metaeditor/compose do not show.
Strange how it can be. I don't understand the problem.


Specially checked now, not a single picture either . IE7. + if I want to click on the link at the bottom of the page MQL4 program throws an error

 
The problem is found out, we will fix it.
 
Looking for missing or extra curly braces.... Quietly losing my mind((

PS
'\end_of_program' - ending bracket '}' expected
 
Climber:
Looking for missing or extra curly braces.... Quietly losing my mind((

"/*" and "*/" to help...
 
komposter:
Climber:

Looking for missing or extra curly braces.... Quietly losing my mind((





"/*" and "*/" to help...



What does it mean? I don't get it 0_o

Everything's fine until this piece appears:
// Критерии закрытия ордеров

if
(_OrdersTotal = 1) //Выполнять следующее если открыт 1 ордер
{
OrderSelect(0, SELECT_BY_POS);
Tip = OrderType;
OPrice = OrderOpenPrice;

if (Tip = 0) // Расчитать цену закрытия в зависимости от типа ордера (В=0,S=1)
{
Cprice = OPrice + (TakeProfit*Point) + Spread;
if (Bid >= Cprice)
{
Cls_B = True;
}
}
if (Tip = 1)
{
Cprice = OPrice - (TakeProfit*Point) - Spread;
if (Ask <= Cprice)
{
Cls_S = True;
}
}
That's where the number of parentheses doesn't match. But if I add it at the end, so many nonsensical errors occur during compilation.
 
Climber:

What does it mean? I don't understand 0_o

See Commentary https://book.mql4.com/ru/basics/common.
 
I don't have any big comments to break down, how does it help me?
I have added to my previous post.
 
commit pieces of code. Once the error is gone, where you commented out and look for the missing parenthesis
 
Climber:
I don't have big comments that need to be broken, how does it help me?
I have supplemented my previous post.


If you put /* somewhere at the top of the program
and somewhere lower you put */
then anything in between will be treated as a comment.

Programmers successfully use this method to find missing brackets.

Usually the part containing the error is more or less clear. This is what they frame /* */. After that they compile the program. If the compiler says there are no errors, then the search area is narrowed down by shifting /* or */ under and over. Back to compilation. As a result, the programmer finds such a small fragment where he/she just sees an error.

Please note that you must not put /* and */ just for logical reasons.

 
Now I understand what those comments are for. But I did a similar thing, only in a different way. I was deleting operators with open and closed brackets. I started with small internal ones and then I was left with the largest ones, covering the deleted small ones, and at the end I had one unclosed one.

If I add closing parenthesis at the very end of code, I get too many errors related to further following code (just in absurd places, like = is not relevant here, or ; doesn't fit too. ...).

And the code itself, which I wrote above in message looks acceptable for operation, which I tried to state them, or it could be written in another way? As it is supposed in the very beginning, if one order is opened, only in this case we should execute operators following after {.

When I started to write this block, I compiled it as I went along (to see errors at once), this error appeared and kept repeating. I thought it was because the closing bracket for start was missing, so I kept on writing.