Help me learn how to program. - page 8

 

Exactly!

(int)(eDate.day_of_year/7)+1;
 
Alexey Viktorov:

Learning while developing? Actually, we are talking about the first steps in programming. It is when writing the first EA that it is best to get results first and then figure out the beauty and brevity of the code.

I am leaving this dialog box now. It is all useless.

I also don't understand why you are writing about brevity and beauty of code. Why, why...

I'm writing about looking in a textbook first before starting to do code. But you're saying he can do it anyway and let him make a thousand mistakes instead of taking a look at how it was done before and how it's right to do it now).

There is no difference, the result will be the same - the person will learn to program.

 
Nikolay Mitrofanov:

...

Attention!

...

Lots of gibberish

...

After all, the developers must have foreseen and optimized the resource consumption of this function!!! They did it! WELL DONE! Kudos to them for this.

So pay attention! Code!!!!

Thanks for the heads up)

I doubt that they have optimized it. Otherwise they would have made it this way:

for(index=PositionsTotal(); index-- > 0;) { /* тело цикла */ }

What for is that uselessly crooked '-1' in variable initialization? It's unnecessary.

 
Igor Makanu:

I think it should be simpler, like this

The sequence number of the day of the year is in theMqlDateTime structure

That's what I understand, but the author of the shithcode doesn't.
 
Tio Nisla:

I doubt it was particularly optimised. Otherwise they would have done it that way:

Why is there a uselessly crooked '-1' in variable initialization? It is unnecessary.

To be honest, I'm seeing this use of the for loop for the first time in my life.

Is it even legal to write this loop????)


I've seen the c while for the first time too. It's something from the new school, it seems) Yo, che cawo, like))

 
Алексей Тарабанов:

There shouldn't be three times, but one time.

Can you draw how to make it so?

Look above, I already gave examples with 'while' and 'for'.

And the reason is that perhaps the author put this call into the algorithm on purpose, "pure coolhatsky", to kill two (three, five, eight...) birds with one stone. And he didn't realize, that the calls are +1 from what he was expecting.

 
Nikolay Mitrofanov:

To be honest, this is the first time I've seen this use of the for loop

Is it even legal to write this loop????)


This is also the first time I've seen c while. It's something from the new school, it seems) Yo, che cawo, like))

Above is a link to a primer, in one of my posts look up 'Cycle for'
 
Igor Makanu:

I think it should be simpler, like this

The sequence number of the day of the year is in theMqlDateTime structure

Another d***b comes up.

 
Tio Nisla:
That's what I understand, but the author of the chitkod can't understand.

Go on, leap for joy...

 

For the particularly gifted: there was no such field in the structure at the time.

And how they were inspired! Eagles, real ones!

Reason: