Self-learning the MQL5 language from scratch - page 6

 
Roman:

Sit 2 ))

What about the MQL5 Handbook, does it lie?

Sincerely, Vladimir.


 
MrBrooklin:

There is no difference between i++ and ++i. It's the same thing!


Regards, Vladimir.

No, postfix is after and prefix is before. The prefix will add one before the calculation in the formula, the postfix after. In the loop, the difference will be one step, if I understand correctly of course).

 
MrBrooklin:

What about the MQL5 Reference Guide, does it lie?

Respectfully, Vladimir.


You should also keep in mind that MQL5 Handbook is not a true source of knowledge.
It contains either typos or not enough information.
They have already recommended you a textbook. No one can tell you better than a textbook.

 
Roman:

It should also be kept in mind that the Mql handbook is not a true source of knowledge.
It contains either typos or not enough information.
You have already been recommended to read a textbook. No one can tell you better than a textbook.

Yes, Roman, I remember your tip. It is impossible to cover everything at once, hence the misunderstanding of many points.

Regards, Vladimir.

 
Valeriy Yastremskiy:

No of course, a postfix is after and a prefix is before. The prefix will add one before the calculation in the formula, the postfix after. In the loop, the difference will be a step, if I understand correctly of course).

Valeri, as I understand it, if one stands either before or after, the sum should not change. Although in the algebra of logic 1+1=1. Many people don't understand it, but all computers use this logic.

Regards, Vladimir.

 
MrBrooklin:

Valery, as I understand it, if one stands either before or after, the sum should not change. Although in the algebra of logic 1+1=1. Many people don't understand it either, but all computers use it.

Regards, Vladimir.

Try a=2; b=2; d=a++; f=++b; // d=2 f=3 with a and b equal to 3

d will first be assigned a value of a, i.e. 2, and only then will 1 be appended to a - this is a postfix.

When f is assigned, 1 is first added to b and then f is assigned as a prefix.

 
Valeriy Yastremskiy:

Try a=2; b=2; d=a++; f=++b; // d=2 f=3 with a and b equal to 3

the d variable will be first assigned a, i.e. 2, and only then will 1 be appended to a - this is the postfix

When f is assigned, b is first appended to 1 and then f is assigned as a prefix.

I agree, Valery, but the question was about i++ and ++i. Also got a D for it. It's not clear yet. It's so sad.

Regards, Vladimir.

 
MrBrooklin:

I agree, Valery, but the question was asked about i++ and ++i. Also got a D for that. It's not clear yet. It is so sad.

Regards, Vladimir.

Well, this is their difference. When one is added. Before using a variable or after using it. These are subtleties, of course. Well, you'd better take them into account. For instance, the loop is over and the iterator will be added or subtracted and expression 2 will become false. And what is not obvious is that the iterator in the loop was the penultimate iterator and the last iterator where the loop has ended will be different from the iterator of the last loop. I hope it is clear)

 
MrBrooklin:

There is no difference between i++ and ++i. It's the same thing!


Sincerely, Vladimir.

That's why I wrote that we need a textbook on c++ for beginners, which Schildt wrote. Exactly a textbook, not documentation and not forum threads where everything ends up in a squabble. Spend a few days reading the first chapters without delving into syntax.
 

not really (not at all) about MQL, but about learning; the moment has come - it's time for children at school to learn programming. So I made an excursus of what and how they can usefully learn.

I noticed that gray Pascal really rules. In terms of learning, even more so than before.

Pascal is not only more accurate than your/our Pythons, but pascalabc.net has educational tools in the form of exercises and problems book inside a nice IDE.
It's better to learn the basics there. And by the way, you can brew DLLs for MT, a.k.a. .net.