Errors, bugs, questions - page 2752

 
Sergey Dzyublik:

At least run a debugger before you write ridiculous statements.
On the second loop i == 1 and j == 1, and on the third loop and so on both are one more.

at least finish school before you accuse strangers of something.

in the russian language, a question mark at the end of a sentence does not necessarily mean assertion!

 
Igor Makanu:

You should at least finish school before accusing strangers of something
In Russian, a question mark at the end of a sentence does not mean a statement!

Sorry for hurting your feelings...
I hope you'll manage to find out how the insidious const modifier works in MQL.

Errors, Bugs, Questions

Igor Makanu,2020.03.21 10:26

it didn't work that way last year - I was purposefully testing the const modifiers
and it seems that@Ilyas explained how to run an MQL-program. First all const and static are initialized no matter where they are described and then the class constructors are called
ok, with this initialization static / const - it can be properly distributed, but the const modifier does not guarantee that the compiler will check it - very unexpected - my second example


 
Sergey Dzyublik:

Sorry if I hurt your dignity...
I hope that you will be able to figure out how the insidious const modifier works in MQL.

Sorry, read the context, including delimiters

You and I have different tasks for being on the forum, you are a know-it-all forum user who raises his skills by answering questions from forum users, while I am not afraid to ask a question on the forum and am not afraid to show my ignorance of it.... Why ask a question if you know the answer?

although perhaps you are a representative of the security industry, once again trying to find my posts in the history of the forum to attach them to the current discussion ... read the first line of this post!

 

During debugging and when the indicator is working itself, in the log, it suddenly writes Stack overflow. When debugging itself, the message "Critical error occurred, debugging stopped" pops up. Here is my similar thread:https://www.mql5.com/ru/forum/338301. But during compilation the compiler doesn't scold and everything goes fine. When debugging, it's impossible to determine at what point the program crashes.

Maybe it's the compiler? I'm not really interested in the compiler I'm using, but in my settings it looks like this:

Compilers

I have VS installed, so I have this link in the settings. So the compiler is appropriate too...? But what compiler was there when I didn't have VS, I honestly didn't get into it. Maybe we should try to go back to that compiler and try to compile the project with it?

Ошибка при дебаге (Возникла критическая ошибка, отладка остановлена)
Ошибка при дебаге (Возникла критическая ошибка, отладка остановлена)
  • 2020.04.23
  • www.mql5.com
Решил поэкспериментировать со стандартным UI компонентом CAppDialog...
 
fxsaber:

Just recently discovered a symbol on which Digits was incorrectly set. Asked the broker to correct it. He did it straight away. Didn't look if value of _Digits and Digits() variable changed. But it's just a fact that the symbol may change its values on the fly.

The value of _Digits should not have changed at least because it is placed in a read-only memory block

 
Mihail Matkovskij:

During debugging and when the indicator is working itself, in the log, it suddenly writes Stack overflow. When debugging itself, the message "Critical error occurred, debugging stopped" pops up. Here is my similar thread:https://www.mql5.com/ru/forum/338301. But during compilation the compiler doesn't scold and everything goes fine. When debugging, it's impossible to determine at what point the program crashes.

Maybe it's the compiler? I'm not really interested in the compiler I'm using, but in my settings it looks like this:

I have VS installed, so I have this link in the settings. So the compiler is appropriate too...? But what compiler was there when I didn't have VS, I honestly didn't get into it. Maybe we should try to go back to that compiler and try to compile the project with it?

How can you change the compiler?

 
A100:

The value of _Digits should not have changed, if only because it is placed in a read-only memory block

It turns out then that this value could be cheating.

 
Andrey Barinov:

It has always been possible (F3). They work.

by F3 do work, but in the menu they don't.

 
fxsaber:

It turns out then that this value can cheat.

Therefore, for the sake of strictness, we should useDigits() instead of _Digits. Then formally there is no logical contradiction - Digits() is not connected by modifier const.

As far as I understood _Digits was needed for compatibility with MT4 - nothing more

 
Igor Makanu:

should the script return sum = 0 ?

or should this script even return a compile-time error?

The function f is executed at each iteration, so it is not 0. I understand what your misunderstanding was about. In C# the const specifier is used only for constant expressions calculated at the compilation stage. In C++ there is an analogue for that: constexpr.And in MQL it does not exist.
Reason: