Errors, bugs, questions - page 240

 

I'm well aware of the truncated evaluation of the condition. I hope that answers part of the question. And the necessary checks will be done. In the second option, if you swap out s1.process and s2.process, the workflow is correct. The question was not about this. I was asking about the overall result. The overall logical result doesn't depend on the shortened evaluation of the condition. The question was about the local variable's behavior as a static variable for objects of one class. As we know, objects of one class overwrite a static variable.

Mine: 'In theory, the code should work exactly the same. But... variants work differently". should be understood as "the return value should be identical, but they are different".

Ais:

It looks like either a hidden recursion, with the usual set of side-effects, or ...


Yes, it looks like recursion. But, the same methods of different objects are called nested. The same one is excluded. By doing the output to the file I found out that d1 leaves the value defined for d1 level below when returning to the level above.

 
Vigor:

I'm well aware of the shortened evaluation of the condition. I hope this answers part of the question. In the second variant, if we swap out s1.process and s2.process, it works correctly. The question was not about this. The question was about the overall result. The general logical result does not depend on shortened condition evaluation. The question was about the local variable's behavior as a static variable for objects of one class. As we know a static variable is overwritten by objects of the same class.

Yes, it looks like recursion. But, the same methods of different objects are called nested. Same methods of the same object are called. Having made output to file found out that d1 leaves value defined for d1 level below when returning to level above.

Show an example to illustrate the problem. What you have given does not show "local variable corruption" in any way. A working code that we could run on our own

 

Why do you have to do everything for the product developers? Lack of confidence in the qualifications of third party developers? It seemed to me that according to my detailed explanations, it's enough to check once again what happens to local variables of methods of one class when they are nested.

OK, if I have some free time I will write a special example.

 
Vigor:

Why do you have to do everything for the product developers? Lack of confidence in the qualifications of third party developers? It seemed to me that according to my detailed explanations, it's enough to check once again what happens to local variables of methods of the same class when they are nested.

OK, if I have some free time I will write a special example.

Is it reproducible under a debugger?
 
Vigor:

Why do you have to do everything for the product developers? Lack of confidence in the qualifications of third party developers? It seemed to me that according to my detailed explanations, it's enough to check once again what happens to local variables of methods of the same class when they are nested.

OK, if I have some free time I will write a special example.

There is no way we can reproduce the above problem.
 

How can I get current prices for different currency pairs in multi-currency? When testing, SymbolInfoTick() returns prices of the current instrument only and generates error 4302 when trying to access other pairs.

 
-Alexey-:

Is it right that by the code of the indicator,

when adding or recompiling it to the chart, the unit is printed 2 times? Is the condition is fulfilled twice in this case? Please explain, I need it to be executed once.

Wouldn't it be easier to put the part that is executed once in the initialisation block?

Or is it necessary to have one execution in indicator's calculator?

 
stringo:
There is no way we can reproduce the above problem.
Example with comments
Files:
overtest.mq5  2 kb
 
mql5:
Is it playing under the debugger?
But under the debugger it's fine.
 
Interesting:

Wouldn't it be easier to put the part that is executed once in the initialisation block?

Or does it need to be executed once in the indicator calculator?

I've found it. In one chart, the minimized window of the second copy of the indicator was - that's why it was printing the second time. So sorry - everything works correctly. I have not noticed it myself :) Deleted my previous posts.
Reason: